Skip to content

Commit

Permalink
FreeBSD: Put the sysctls under hw.
Browse files Browse the repository at this point in the history
It make more sense than dev. as other sysctls for tuning hardware are
already under hw. and dev. is for tuning device drivers not globals to
the hardware.

Signed-off-by: Emmanuel Vadot <[email protected]>
  • Loading branch information
evadot committed May 24, 2020
1 parent da847cb commit 6ab0129
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "amdgpu_amdkfd.h"

#ifdef __FreeBSD__
SYSCTL_NODE(_dev, OID_AUTO, amdgpu,
SYSCTL_NODE(_hw, OID_AUTO, amdgpu,
CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
DRIVER_DESC " parameters");
#endif
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "amd_shared.h"

#ifdef __FreeBSD__
SYSCTL_DECL(_dev_amdgpu);
SYSCTL_DECL(_hw_amdgpu);
#endif

/* General customization:
Expand Down
18 changes: 12 additions & 6 deletions drivers/gpu/drm/drm_os_freebsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,26 @@ MALLOC_DEFINE(DRM_MEM_DMA, "drm_dma", "DRM DMA Data Structures");
MALLOC_DEFINE(DRM_MEM_DRIVER, "drm_driver", "DRM DRIVER Data Structures");
MALLOC_DEFINE(DRM_MEM_KMS, "drm_kms", "DRM KMS Data Structures");

SYSCTL_NODE(_dev, OID_AUTO, drm, CTLFLAG_RW, 0, "DRM args");
SYSCTL_INT(_dev_drm, OID_AUTO, drm_debug, CTLFLAG_RWTUN, &drm_debug, 0, "drm debug flags");
SYSCTL_NODE(_dev, OID_AUTO, drm, CTLFLAG_RW, 0, "DRM args (compat)");
SYSCTL_INT(_dev_drm, OID_AUTO, drm_debug, CTLFLAG_RWTUN, &drm_debug, 0, "drm debug flags (compat)");
SYSCTL_NODE(_hw, OID_AUTO, dri, CTLFLAG_RW, 0, "DRI args");
SYSCTL_INT(_hw_dri, OID_AUTO, drm_debug, CTLFLAG_RWTUN, &drm_debug, 0, "drm debug flags");
extern int skip_ddb;
SYSCTL_INT(_dev_drm, OID_AUTO, skip_ddb, CTLFLAG_RWTUN, &skip_ddb, 0, "go straight to dumping core");
SYSCTL_INT(_dev_drm, OID_AUTO, skip_ddb, CTLFLAG_RWTUN, &skip_ddb, 0, "go straight to dumping core (compat)");
SYSCTL_INT(_hw_dri, OID_AUTO, skip_ddb, CTLFLAG_RWTUN, &skip_ddb, 0, "go straight to dumping core");
#if defined(DRM_DEBUG_LOG_ALL)
int drm_debug_persist = 1;
#else
int drm_debug_persist = 0;
#endif
SYSCTL_INT(_dev_drm, OID_AUTO, drm_debug_persist, CTLFLAG_RWTUN, &drm_debug_persist, 0, "keep drm debug flags post-load");
SYSCTL_INT(_dev_drm, OID_AUTO, drm_debug_persist, CTLFLAG_RWTUN, &drm_debug_persist, 0, "keep drm debug flags post-load (compat)");
SYSCTL_INT(_hw_dri, OID_AUTO, drm_debug_persist, CTLFLAG_RWTUN, &drm_debug_persist, 0, "keep drm debug flags post-load");
int drm_panic_on_error = 0;
SYSCTL_INT(_dev_drm, OID_AUTO, error_panic, CTLFLAG_RWTUN, &drm_panic_on_error, 0, "panic if an ERROR is hit");
SYSCTL_INT(_dev_drm, OID_AUTO, error_panic, CTLFLAG_RWTUN, &drm_panic_on_error, 0, "panic if an ERROR is hit (compat)");
SYSCTL_INT(_hw_dri, OID_AUTO, error_panic, CTLFLAG_RWTUN, &drm_panic_on_error, 0, "panic if an ERROR is hit");
int drm_always_interruptible;
SYSCTL_INT(_dev_drm, OID_AUTO, always_interruptible, CTLFLAG_RWTUN, &drm_always_interruptible, 0, "always allow a thread to be interrupted in driver wait");
SYSCTL_INT(_dev_drm, OID_AUTO, always_interruptible, CTLFLAG_RWTUN, &drm_always_interruptible, 0, "always allow a thread to be interrupted in driver wait (compat)");
SYSCTL_INT(_hw_dri, OID_AUTO, always_interruptible, CTLFLAG_RWTUN, &drm_always_interruptible, 0, "always allow a thread to be interrupted in driver wait");

static struct callout reset_debug_log_handle;

Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/drm_sysctl_freebsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ drm_sysctl_init(struct drm_device *dev)
/* Find the next free slot under hw.dri */
i = 0;
SLIST_FOREACH(oid, SYSCTL_CHILDREN(drioid), oid_link) {
if (i <= oid->oid_arg2)
i = oid->oid_arg2 + 1;
if (i == oid->oid_name[0] - '0' && oid->oid_name[1] == 0)
i++;
}
if (i > 9) {
drm_sysctl_cleanup(dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "i915_drv.h"

#ifdef __FreeBSD__
SYSCTL_NODE(_dev, OID_AUTO, i915kms,
SYSCTL_NODE(_hw, OID_AUTO, i915kms,
CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
DRIVER_DESC " parameters");
#endif
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <linux/cache.h> /* for __read_mostly */

#ifdef __FreeBSD__
SYSCTL_DECL(_dev_i915kms);
SYSCTL_DECL(_hw_i915kms);
#endif

struct drm_printer;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/radeon_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include <drm/drm_probe_helper.h>

#ifdef __FreeBSD__
SYSCTL_NODE(_dev, OID_AUTO, radeonkms,
SYSCTL_NODE(_hw, OID_AUTO, radeonkms,
CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
DRIVER_DESC " parameters");
#endif
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/radeon/radeon_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "radeon_family.h"

#ifdef __FreeBSD__
SYSCTL_DECL(_dev_radeonkms);
SYSCTL_DECL(_hw_radeonkms);
#endif

/* General customization:
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vboxvideo/vbox_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "vbox_drv.h"

#ifdef __FreeBSD__
SYSCTL_NODE(_dev, OID_AUTO, vboxvideo,
SYSCTL_NODE(_hw, OID_AUTO, vboxvideo,
CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
DRIVER_DESC " parameters");
#endif
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vboxvideo/vbox_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ static inline void vbox_write_ioport(u16 index, u16 data)
}

#ifdef __FreeBSD__
SYSCTL_DECL(_dev_vboxvideo);
SYSCTL_DECL(_hw_vboxvideo);
#endif

#endif
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#define VMWGFX_VALIDATION_MEM_GRAN (16*PAGE_SIZE)

#ifdef __FreeBSD__
SYSCTL_NODE(_dev, OID_AUTO, vmwgfx,
SYSCTL_NODE(_hw, OID_AUTO, vmwgfx,
CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
VMWGFX_DRIVER_DESC " parameters");
#endif
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#ifdef __FreeBSD__
/* BSD: Make sure we get out[bwl] redefines */
#include <linux/compiler.h>
SYSCTL_DECL(_dev_vmwgfx);
SYSCTL_DECL(_hw_vmwgfx);

static inline void
spin_lock_init_spin(spinlock_t *lock)
Expand Down
2 changes: 1 addition & 1 deletion drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ CFLAGS+= -I${.CURDIR:H}/include/uapi
CFLAGS+= -I${SRCDIR:H}

CFLAGS+= '-DKBUILD_MODNAME="${KMOD}"'
CFLAGS+= '-DLINUXKPI_PARAM_PREFIX=drm_' -DDRM_SYSCTL_PARAM_PREFIX=_${KMOD} -DLINUXKPI_VERSION=50000
CFLAGS+= '-DLINUXKPI_PARAM_PREFIX=drm_' -DDRM_SYSCTL_PARAM_PREFIX=_dri -DLINUXKPI_VERSION=50000
CFLAGS+= ${KCONFIG:C/(.*)/-DCONFIG_\1/}

SRCS+= device_if.h \
Expand Down
3 changes: 2 additions & 1 deletion linuxkpi/gplv2/include/linux/moduleparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#endif

#ifndef DRM_PARAM_PARENT
#define DRM_PARAM_PARENT _dev
#define DRM_PARAM_PARENT _hw
#endif

#ifndef LINUXKPI_PARAM_PREFIX
Expand All @@ -60,6 +60,7 @@
#define DRM_PARAM_NAME LINUXKPI_PARAM_CONCAT(DRM_PARAM_PARENT,DRM_SYSCTL_PARAM_PREFIX,,)

/* No good place to put it (manu 20200522) */
SYSCTL_DECL(_hw_dri);
SYSCTL_DECL(_dev_drm);

#define LINUXKPI_PARAM_bool(name, var, perm) \
Expand Down

0 comments on commit 6ab0129

Please sign in to comment.