Skip to content

Commit 82d5e73

Browse files
David Herrmanndanvet
authored andcommitted
drm: drop obsolete drm_core.h
The drm_core.h header contains a set of constants meant to be used throughout DRM. However, as it turns out, they're each used just once and don't bring any benefit. They're also grossly mis-named and lack name-spacing. This patch inlines them, or moves them into drm_internal.h as appropriate: - CORE_AUTHOR and CORE_DESC are inlined into corresponding MODULE_*() macros. It's just confusing having to follow 2 pointers when trying to find the definition of these fields. Grep'ping for MODULE_AUTHOR() should reveal the full information, if there's no strong reason not to. - CORE_NAME, CORE_DATE, CORE_MAJOR, CORE_MINOR, and CORE_PATCHLEVEL are inlined into the sysfs 'version' attribute. They're stripped everywhere else (which is just some printk() statements). CORE_NAME just doesn't make *any* sense, as we hard-code it in many places, anyway. The other constants are outdated and just serve binary-compatibility purposes. Hence, inline them in 'version' sysfs attribute (we might even try dropping it..). - DRM_IF_MAJOR and DRM_IF_MINOR are moved into drm_internal.h as they're only used by the global ioctl handlers. Furthermore, versioning interfaces breaks backports and as such is deprecated, anyway. We just keep them for historic reasons. I doubt anyone will ever modify them again. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20160901124837.680-6-dh.herrmann@gmail.com
1 parent d9a1f0b commit 82d5e73

6 files changed

Lines changed: 7 additions & 48 deletions

File tree

‎drivers/gpu/drm/drm_drv.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <linux/mount.h>
3434
#include <linux/slab.h>
3535
#include <drm/drmP.h>
36-
#include <drm/drm_core.h>
3736
#include "drm_crtc_internal.h"
3837
#include "drm_legacy.h"
3938
#include "drm_internal.h"
@@ -46,8 +45,8 @@
4645
unsigned int drm_debug = 0;
4746
EXPORT_SYMBOL(drm_debug);
4847

49-
MODULE_AUTHOR(CORE_AUTHOR);
50-
MODULE_DESCRIPTION(CORE_DESC);
48+
MODULE_AUTHOR("Gareth Hughes, Leif Delgass, José Fonseca, Jon Smirl");
49+
MODULE_DESCRIPTION("DRM shared core routines");
5150
MODULE_LICENSE("GPL and additional rights");
5251
MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug category.\n"
5352
"\t\tBit 0 (0x01) will enable CORE messages (drm core code)\n"
@@ -845,8 +844,7 @@ static int __init drm_core_init(void)
845844
goto err_p3;
846845
}
847846

848-
DRM_INFO("Initialized %s %d.%d.%d %s\n",
849-
CORE_NAME, CORE_MAJOR, CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE);
847+
DRM_INFO("Initialized\n");
850848
return 0;
851849
err_p3:
852850
drm_sysfs_destroy();

‎drivers/gpu/drm/drm_internal.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
* OTHER DEALINGS IN THE SOFTWARE.
2222
*/
2323

24+
#define DRM_IF_MAJOR 1
25+
#define DRM_IF_MINOR 4
26+
2427
/* drm_irq.c */
2528
extern unsigned int drm_timestamp_monotonic;
2629

‎drivers/gpu/drm/drm_ioc32.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <linux/export.h>
3333

3434
#include <drm/drmP.h>
35-
#include <drm/drm_core.h>
3635

3736
#define DRM_IOCTL_VERSION32 DRM_IOWR(0x00, drm_version32_t)
3837
#define DRM_IOCTL_GET_UNIQUE32 DRM_IOWR(0x01, drm_unique32_t)

‎drivers/gpu/drm/drm_ioctl.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
*/
3030

3131
#include <drm/drmP.h>
32-
#include <drm/drm_core.h>
3332
#include <drm/drm_auth.h>
3433
#include "drm_legacy.h"
3534
#include "drm_internal.h"

‎drivers/gpu/drm/drm_sysfs.c‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <linux/export.h>
2020

2121
#include <drm/drm_sysfs.h>
22-
#include <drm/drm_core.h>
2322
#include <drm/drmP.h>
2423
#include "drm_internal.h"
2524

@@ -37,12 +36,7 @@ static char *drm_devnode(struct device *dev, umode_t *mode)
3736
return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev));
3837
}
3938

40-
static CLASS_ATTR_STRING(version, S_IRUGO,
41-
CORE_NAME " "
42-
__stringify(CORE_MAJOR) "."
43-
__stringify(CORE_MINOR) "."
44-
__stringify(CORE_PATCHLEVEL) " "
45-
CORE_DATE);
39+
static CLASS_ATTR_STRING(version, S_IRUGO, "drm 1.1.0 20060810");
4640

4741
/**
4842
* drm_sysfs_init - initialize sysfs helpers

‎include/drm/drm_core.h‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)