Skip to contentSkip to conversation

drm/amd: include drm/drm_edid.h only where needed

PATCH In review Jani Nikula 2 participants 2 messages Dec 12, 2023

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

PATCH 1/1 drm/amd: include drm/drm_edid.h only where needed

Including drm_edid.h from amdgpu_mode.h causes the rebuild of literally hundreds of files when drm_edid.h is modified, while there are only a handful of files that actually need to include drm_edid.h.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h                    | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c                    | 1 +
 drivers/gpu/drm/amd/amdgpu/atombios_encoders.c              | 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c                      | 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c                      | 1 +
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 1 +
 6 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +1 -1
index 32fe05c810c6..3802ccdf6f55 100644
@@ -32,7 +32,6 @@
 
 #include <drm/display/drm_dp_helper.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_encoder.h>
 #include <drm/drm_fixed.h>
 #include <drm/drm_framebuffer.h>
@@ -51,6 +50,7 @@ struct amdgpu_device;
 struct amdgpu_encoder;
 struct amdgpu_router;
 struct amdgpu_hpd;
+struct edid;
 
 #define to_amdgpu_crtc(x) container_of(x, struct amdgpu_crtc, base)
 #define to_amdgpu_connector(x) container_of(x, struct amdgpu_connector, base)
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +1 -0
index db6fc0cb18eb..453a4b786cfc 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_edid.h>
 #include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 
drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +1 -0
index 3ee219aa2891..7672abe6c140 100644
@@ -28,6 +28,7 @@
 
 #include <acpi/video.h>
 
+#include <drm/drm_edid.h>
 #include <drm/amdgpu_drm.h>
 #include "amdgpu.h"
 #include "amdgpu_connectors.h"
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +1 -0
index bb666cb7522e..587ee632a3b8 100644
@@ -21,6 +21,7 @@
  *
  */
 
+#include <drm/drm_edid.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_modeset_helper.h>
 #include <drm/drm_modeset_helper_vtables.h>
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +1 -0
index 7af277f61cca..f22ec27365bd 100644
@@ -21,6 +21,7 @@
  *
  */
 
+#include <drm/drm_edid.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_modeset_helper.h>
 #include <drm/drm_modeset_helper_vtables.h>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +1 -0
index b599efda3b19..6f8128130b62 100644
@@ -27,6 +27,7 @@
 #include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_edid.h>
 #include <drm/drm_fixed.h>
 #include "dm_services.h"
 #include "amdgpu.h"
Signature · 1 line
2.39.2
#1 lore raw

Applied with some minor fixups for our -next tree.

Thanks!

Alex

Quoted 98 lines · Jani Nikula

Including drm_edid.h from amdgpu_mode.h causes the rebuild of literally hundreds of files when drm_edid.h is modified, while there are only a handful of files that actually need to include drm_edid.h.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h                    | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c                    | 1 +
 drivers/gpu/drm/amd/amdgpu/atombios_encoders.c              | 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c                      | 1 +
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c                      | 1 +
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 1 +
 6 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +1 -1
index 32fe05c810c6..3802ccdf6f55 100644
@@ -32,7 +32,6 @@
 
 #include <drm/display/drm_dp_helper.h>
 #include <drm/drm_crtc.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_encoder.h>
 #include <drm/drm_fixed.h>
 #include <drm/drm_framebuffer.h>
@@ -51,6 +50,7 @@ struct amdgpu_device;
 struct amdgpu_encoder;
 struct amdgpu_router;
 struct amdgpu_hpd;
+struct edid;
 
 #define to_amdgpu_crtc(x) container_of(x, struct amdgpu_crtc, base)
 #define to_amdgpu_connector(x) container_of(x, struct amdgpu_connector, base)
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +1 -0
index db6fc0cb18eb..453a4b786cfc 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_edid.h>
 #include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 
drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +1 -0
index 3ee219aa2891..7672abe6c140 100644
@@ -28,6 +28,7 @@
 
 #include <acpi/video.h>
 
+#include <drm/drm_edid.h>
 #include <drm/amdgpu_drm.h>
 #include "amdgpu.h"
 #include "amdgpu_connectors.h"
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +1 -0
index bb666cb7522e..587ee632a3b8 100644
@@ -21,6 +21,7 @@
  *
  */
 
+#include <drm/drm_edid.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_modeset_helper.h>
 #include <drm/drm_modeset_helper_vtables.h>
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +1 -0
index 7af277f61cca..f22ec27365bd 100644
@@ -21,6 +21,7 @@
  *
  */
 
+#include <drm/drm_edid.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_modeset_helper.h>
 #include <drm/drm_modeset_helper_vtables.h>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +1 -1
index b599efda3b19..6f8128130b62 100644
@@ -27,6 +27,7 @@
 #include <drm/display/drm_dp_mst_helper.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_edid.h>
 #include <drm/drm_fixed.h>
 #include "dm_services.h"
 #include "amdgpu.h"
--

2.39.2