Skip to contentSkip to conversation

drm: Don't export internal module variables

PATCH In review Daniel Vetter 2 participants 2 messages May 29, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Don't export internal module variables

Drivers really have no business touching these. Noticed because exynose _did_ touch the vblank off delay, which could potentially affect other drivers.

drm_debug is an exception since it's used in macros and inline functions.

---
 drivers/gpu/drm/drm_stub.c              | 12 ++++--------
 drivers/gpu/drm/exynos/exynos_drm_drv.c |  4 ----
 drivers/gpu/drm/exynos/exynos_drm_drv.h |  2 --
 3 files changed, 4 insertions(+), 14 deletions(-)
drivers/gpu/drm/drm_stub.c +4 -8
index 3727ac8bc310..3901b41c214b 100644
@@ -42,18 +42,14 @@
 unsigned int drm_debug = 0;	/* 1 to enable debug output */
 EXPORT_SYMBOL(drm_debug);
 
-unsigned int drm_rnodes = 0;	/* 1 to enable experimental render nodes API */
-EXPORT_SYMBOL(drm_rnodes);
+int drm_rnodes = 0;	/* 1 to enable experimental render nodes API */
 
 /* 1 to allow user space to request universal planes (experimental) */
-unsigned int drm_universal_planes = 0;
-EXPORT_SYMBOL(drm_universal_planes);
+int drm_universal_planes = 0;
 
-unsigned int drm_vblank_offdelay = 5000;    /* Default to 5000 msecs. */
-EXPORT_SYMBOL(drm_vblank_offdelay);
+int drm_vblank_offdelay = 5000;    /* Default to 5000 msecs. */
 
-unsigned int drm_timestamp_precision = 20;  /* Default to 20 usecs. */
-EXPORT_SYMBOL(drm_timestamp_precision);
+int drm_timestamp_precision = 20;  /* Default to 20 usecs. */
 
 /*
  * Default to use monotonic timestamps for wait-for-vblank and page-flip
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -4
index 2d27ba23a6a8..d7c50b0da510 100644
@@ -38,8 +38,6 @@
 #define DRIVER_MAJOR	1
 #define DRIVER_MINOR	0
 
-#define VBLANK_OFF_DELAY	50000
-
 /* platform device pointer for eynos drm device. */
 static struct platform_device *exynos_drm_pdev;
 
@@ -109,8 +107,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
 	/* setup possible_clones. */
 	exynos_drm_encoder_setup(dev);
 
-	drm_vblank_offdelay = VBLANK_OFF_DELAY;
-
 	platform_set_drvdata(dev->platformdev, dev);
 
 	/* force connectors detection */
drivers/gpu/drm/exynos/exynos_drm_drv.h +0 -2
index ce3e6a30deaa..e28f792d628c 100644
@@ -40,8 +40,6 @@ struct drm_device;
 struct exynos_drm_overlay;
 struct drm_connector;
 
-extern unsigned int drm_vblank_offdelay;
-
 /* this enumerates display type. */
 enum exynos_drm_output_type {
 	EXYNOS_DISPLAY_TYPE_NONE,
Signature · 1 line
1.9.2
#1 lore raw
Quoted 9 lines · Daniel Vetter

Drivers really have no business touching these. Noticed because exynose _did_ touch the vblank off delay, which could potentially affect other drivers.

drm_debug is an exception since it's used in macros and inline functions.

Seems reasonable to me. Was the type change intentional?

Alex

Quoted 75 lines
---
 drivers/gpu/drm/drm_stub.c              | 12 ++++--------
 drivers/gpu/drm/exynos/exynos_drm_drv.c |  4 ----
 drivers/gpu/drm/exynos/exynos_drm_drv.h |  2 --
 3 files changed, 4 insertions(+), 14 deletions(-)
drivers/gpu/drm/drm_stub.c +4 -8
index 3727ac8bc310..3901b41c214b 100644
@@ -42,18 +42,14 @@
 unsigned int drm_debug = 0;    /* 1 to enable debug output */
 EXPORT_SYMBOL(drm_debug);
 
-unsigned int drm_rnodes = 0;   /* 1 to enable experimental render nodes API */
-EXPORT_SYMBOL(drm_rnodes);
+int drm_rnodes = 0;    /* 1 to enable experimental render nodes API */
 
 /* 1 to allow user space to request universal planes (experimental) */
-unsigned int drm_universal_planes = 0;
-EXPORT_SYMBOL(drm_universal_planes);
+int drm_universal_planes = 0;
 
-unsigned int drm_vblank_offdelay = 5000;    /* Default to 5000 msecs. */
-EXPORT_SYMBOL(drm_vblank_offdelay);
+int drm_vblank_offdelay = 5000;    /* Default to 5000 msecs. */
 
-unsigned int drm_timestamp_precision = 20;  /* Default to 20 usecs. */
-EXPORT_SYMBOL(drm_timestamp_precision);
+int drm_timestamp_precision = 20;  /* Default to 20 usecs. */
 
 /*
  * Default to use monotonic timestamps for wait-for-vblank and page-flip
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -4
index 2d27ba23a6a8..d7c50b0da510 100644
@@ -38,8 +38,6 @@
 #define DRIVER_MAJOR   1
 #define DRIVER_MINOR   0
 
-#define VBLANK_OFF_DELAY       50000
-
 /* platform device pointer for eynos drm device. */
 static struct platform_device *exynos_drm_pdev;
 
@@ -109,8 +107,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
        /* setup possible_clones. */
        exynos_drm_encoder_setup(dev);
 
-       drm_vblank_offdelay = VBLANK_OFF_DELAY;
-
        platform_set_drvdata(dev->platformdev, dev);
 
        /* force connectors detection */
drivers/gpu/drm/exynos/exynos_drm_drv.h +0 -3
index ce3e6a30deaa..e28f792d628c 100644
@@ -40,8 +40,6 @@ struct drm_device;
 struct exynos_drm_overlay;
 struct drm_connector;
 
-extern unsigned int drm_vblank_offdelay;
-
 /* this enumerates display type. */
 enum exynos_drm_output_type {
        EXYNOS_DISPLAY_TYPE_NONE,
--

1.9.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel