Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD: support charp module_params like hw.amdgpu.virtual_display, fixes #134 #146

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ module_param_named(pg_mask, amdgpu_pg_mask, uint, 0444);
MODULE_PARM_DESC(sdma_phase_quantum, "SDMA context switch phase quantum (x 1K GPU clock cycles, 0 = no change (default 32))");
module_param_named(sdma_phase_quantum, amdgpu_sdma_phase_quantum, uint, 0444);

#ifdef __linux__
/**
* DOC: disable_cu (charp)
* Set to disable CUs (It's set like se.sh.cu,...). The default is NULL.
Expand All @@ -526,7 +525,6 @@ module_param_named(disable_cu, amdgpu_disable_cu, charp, 0444);
MODULE_PARM_DESC(virtual_display,
"Enable virtual display feature (the virtual_display will be set like xxxx:xx:xx.x,x;xxxx:xx:xx.x,x)");
module_param_named(virtual_display, amdgpu_virtual_display, charp, 0444);
#endif

/**
* DOC: job_hang_limit (int)
Expand Down
11 changes: 11 additions & 0 deletions linuxkpi/bsd/include/linux/moduleparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

#include <linux/types.h>

extern int lkpi_sysctl_handle_charp(SYSCTL_HANDLER_ARGS);

#ifndef LINUXKPI_PARAM_PARENT
#define LINUXKPI_PARAM_PARENT _compat_linuxkpi
#endif
Expand Down Expand Up @@ -148,6 +150,15 @@ SYSCTL_DECL(_dev_drm);
name, LINUXKPI_PARAM_PERM(perm), &(var), 0,\
LINUXKPI_PARAM_DESC(name)))

#define LINUXKPI_PARAM_charp(name, var, perm) \
extern const char LINUXKPI_PARAM_DESC(name)[]; \
LINUXKPI_PARAM_PASS(SYSCTL_PROC(LINUXKPI_PARAM_PARENT, OID_AUTO, \
LINUXKPI_PARAM_NAME(name), LINUXKPI_PARAM_PERM(perm) | CTLTYPE_STRING | CTLFLAG_MPSAFE, \
&(var), 0, lkpi_sysctl_handle_charp, "A", LINUXKPI_PARAM_DESC(name))); \
LINUXKPI_PARAM_PASS(SYSCTL_PROC(DRM_PARAM_NAME, OID_AUTO, \
name, LINUXKPI_PARAM_PERM(perm) | CTLTYPE_STRING | CTLFLAG_MPSAFE, \
&(var), 0, lkpi_sysctl_handle_charp, "A", LINUXKPI_PARAM_DESC(name)))

#define module_param_string(name, str, len, perm) \
extern const char LINUXKPI_PARAM_DESC(name)[]; \
LINUXKPI_PARAM_PASS(SYSCTL_STRING(LINUXKPI_PARAM_PARENT, OID_AUTO,\
Expand Down