Skip to content

Commit d7d2c48

Browse files
David Herrmannairlied
authored andcommitted
drm: move remaining includes in drmP.h to the top
Including headers somewhere else but at the top is ugly, deprecated and was used in early days only to speed up compile-times. Those days are over. Make headers independent and then move the inclusions to the top. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
1 parent 69d516c commit d7d2c48

3 files changed

Lines changed: 22 additions & 23 deletions

File tree

‎include/drm/drmP.h‎

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
/**
2-
* \file drmP.h
3-
* Private header for Direct Rendering Manager
4-
*
5-
* \author Rickard E. (Rik) Faith <faith@valinux.com>
6-
* \author Gareth Hughes <gareth@valinux.com>
7-
*/
8-
91
/*
2+
* Internal Header for the Direct Rendering Manager
3+
*
104
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
115
* Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
126
* Copyright (c) 2009-2010, Code Aurora Forum.
137
* All rights reserved.
148
*
9+
* Author: Rickard E. (Rik) Faith <faith@valinux.com>
10+
* Author: Gareth Hughes <gareth@valinux.com>
11+
*
1512
* Permission is hereby granted, free of charge, to any person obtaining a
1613
* copy of this software and associated documentation files (the "Software"),
1714
* to deal in the Software without restriction, including without limitation
@@ -64,8 +61,14 @@
6461
#include <asm/pgalloc.h>
6562
#include <asm/uaccess.h>
6663

67-
#include <drm/drm.h>
64+
#include <uapi/drm/drm.h>
65+
#include <uapi/drm/drm_mode.h>
66+
67+
#include <drm/drm_agpsupport.h>
68+
#include <drm/drm_crtc.h>
69+
#include <drm/drm_global.h>
6870
#include <drm/drm_hashtab.h>
71+
#include <drm/drm_mem_util.h>
6972
#include <drm/drm_mm.h>
7073
#include <drm/drm_os_linux.h>
7174
#include <drm/drm_sarea.h>
@@ -564,8 +567,6 @@ struct drm_gem_object {
564567
struct dma_buf_attachment *import_attach;
565568
};
566569

567-
#include <drm/drm_crtc.h>
568-
569570
/**
570571
* struct drm_master - drm master structure
571572
*
@@ -1228,10 +1229,6 @@ extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc);
12281229
extern int drm_modeset_ctl(struct drm_device *dev, void *data,
12291230
struct drm_file *file_priv);
12301231

1231-
/* AGP/GART support (drm_agpsupport.h) */
1232-
1233-
#include <drm/drm_agpsupport.h>
1234-
12351232
/* Stub support (drm_stub.h) */
12361233
extern int drm_setmaster_ioctl(struct drm_device *dev, void *data,
12371234
struct drm_file *file_priv);
@@ -1397,8 +1394,6 @@ int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size,
13971394
struct vm_area_struct *vma);
13981395
int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
13991396

1400-
#include <drm/drm_global.h>
1401-
14021397
static inline void
14031398
drm_gem_object_reference(struct drm_gem_object *obj)
14041399
{
@@ -1472,8 +1467,6 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map)
14721467
{
14731468
}
14741469

1475-
#include <drm/drm_mem_util.h>
1476-
14771470
struct drm_device *drm_dev_alloc(struct drm_driver *driver,
14781471
struct device *parent);
14791472
void drm_dev_ref(struct drm_device *dev);

‎include/drm/drm_agpsupport.h‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
#ifndef _DRM_AGPSUPPORT_H_
22
#define _DRM_AGPSUPPORT_H_
33

4+
#include <linux/agp_backend.h>
45
#include <linux/kernel.h>
6+
#include <linux/list.h>
57
#include <linux/mm.h>
68
#include <linux/mutex.h>
79
#include <linux/types.h>
8-
#include <linux/agp_backend.h>
9-
#include <drm/drmP.h>
10+
#include <uapi/drm/drm.h>
11+
12+
struct drm_device;
13+
struct drm_file;
1014

1115
#define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && \
1216
defined(MODULE)))
@@ -61,6 +65,7 @@ int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
6165
int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
6266
int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
6367
struct drm_file *file_priv);
68+
6469
#else /* __OS_HAS_AGP */
6570

6671
static inline void drm_free_agp(struct agp_memory * handle, int pages)
@@ -188,6 +193,7 @@ static inline int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
188193
{
189194
return -ENODEV;
190195
}
196+
191197
#endif /* __OS_HAS_AGP */
192198

193199
#endif /* _DRM_AGPSUPPORT_H_ */

‎include/drm/drm_crtc.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
#include <linux/idr.h>
3232
#include <linux/fb.h>
3333
#include <linux/hdmi.h>
34-
#include <drm/drm_mode.h>
35-
#include <drm/drm_fourcc.h>
34+
#include <uapi/drm/drm_mode.h>
35+
#include <uapi/drm/drm_fourcc.h>
3636
#include <drm/drm_modeset_lock.h>
3737

3838
struct drm_device;

0 commit comments

Comments
 (0)