Skip to contentSkip to conversation

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

PATCH New Jani Nikula 3 participants 4 messages Dec 12, 2023 – Dec 14, 2023

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

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

Reduce the need for rebuilds when drm_edid.h is modified by including it only where needed.

---
 drivers/gpu/drm/tegra/drm.h    | 2 +-
 drivers/gpu/drm/tegra/output.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/tegra/drm.h +1 -1
index ccb5d74fa227..682011166a8f 100644
@@ -13,7 +13,6 @@
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_bridge.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_encoder.h>
 #include <drm/drm_fixed.h>
 #include <drm/drm_probe_helper.h>
@@ -26,6 +25,7 @@
 /* XXX move to include/uapi/drm/drm_fourcc.h? */
 #define DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT BIT_ULL(22)
 
+struct edid;
 struct reset_control;
 
 struct tegra_drm {
drivers/gpu/drm/tegra/output.c +1 -0
index dc2dcb5ca1c8..88af956ad0e7 100644
@@ -8,6 +8,7 @@
 #include <linux/of.h>
 
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_edid.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_simple_kms_helper.h>
Signature · 1 line
2.39.2
#1 lore raw
kernel test robot noticed the following build errors:

Hi Jani,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm/drm-next]
[also build test ERROR on drm-exynos/exynos-drm-next drm-intel/for-linux-next drm-intel/for-linux-next-fixes drm-misc/drm-misc-next drm-tip/drm-tip linus/master v6.7-rc5 next-20231212] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jani-Nikula/drm-tegra-include-drm-drm_edid-h-only-where-needed/20231212-222603
base:   git://anongit.freedesktop.org/drm/drm drm-next
patch link:    https://lore.kernel.org/r/20231212142409.3826544-1-jani.nikula%40intel.com
patch subject: [PATCH] drm/tegra: include drm/drm_edid.h only where needed
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20231213/[email protected]/config)
compiler: s390-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231213/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/gpu/drm/tegra/sor.c: In function 'tegra_sor_hdmi_setup_avi_infoframe':

>> drivers/gpu/drm/tegra/sor.c:1928:15: error: implicit declaration of function 'drm_hdmi_avi_infoframe_from_display_mode' [-Werror=implicit-function-declaration]

1928 | err = drm_hdmi_avi_infoframe_from_display_mode(&frame,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors

vim +/drm_hdmi_avi_infoframe_from_display_mode +1928 drivers/gpu/drm/tegra/sor.c

459cc2c6800b54 Thierry Reding 2015-07-30  1911  
459cc2c6800b54 Thierry Reding 2015-07-30  1912  static int
459cc2c6800b54 Thierry Reding 2015-07-30  1913  tegra_sor_hdmi_setup_avi_infoframe(struct tegra_sor *sor,
459cc2c6800b54 Thierry Reding 2015-07-30  1914  				   const struct drm_display_mode *mode)
459cc2c6800b54 Thierry Reding 2015-07-30  1915  {
459cc2c6800b54 Thierry Reding 2015-07-30  1916  	u8 buffer[HDMI_INFOFRAME_SIZE(AVI)];
459cc2c6800b54 Thierry Reding 2015-07-30  1917  	struct hdmi_avi_infoframe frame;
459cc2c6800b54 Thierry Reding 2015-07-30  1918  	u32 value;
459cc2c6800b54 Thierry Reding 2015-07-30  1919  	int err;
459cc2c6800b54 Thierry Reding 2015-07-30  1920  
459cc2c6800b54 Thierry Reding 2015-07-30  1921  	/* disable AVI infoframe */
459cc2c6800b54 Thierry Reding 2015-07-30  1922  	value = tegra_sor_readl(sor, SOR_HDMI_AVI_INFOFRAME_CTRL);
459cc2c6800b54 Thierry Reding 2015-07-30  1923  	value &= ~INFOFRAME_CTRL_SINGLE;
459cc2c6800b54 Thierry Reding 2015-07-30  1924  	value &= ~INFOFRAME_CTRL_OTHER;
459cc2c6800b54 Thierry Reding 2015-07-30  1925  	value &= ~INFOFRAME_CTRL_ENABLE;
459cc2c6800b54 Thierry Reding 2015-07-30  1926  	tegra_sor_writel(sor, value, SOR_HDMI_AVI_INFOFRAME_CTRL);
459cc2c6800b54 Thierry Reding 2015-07-30  1927  
13d0add333afea Ville Syrjälä  2019-01-08 @1928  	err = drm_hdmi_avi_infoframe_from_display_mode(&frame,
13d0add333afea Ville Syrjälä  2019-01-08  1929  						       &sor->output.connector, mode);
459cc2c6800b54 Thierry Reding 2015-07-30  1930  	if (err < 0) {
459cc2c6800b54 Thierry Reding 2015-07-30  1931  		dev_err(sor->dev, "failed to setup AVI infoframe: %d\n", err);
459cc2c6800b54 Thierry Reding 2015-07-30  1932  		return err;
459cc2c6800b54 Thierry Reding 2015-07-30  1933  	}
459cc2c6800b54 Thierry Reding 2015-07-30  1934  
459cc2c6800b54 Thierry Reding 2015-07-30  1935  	err = hdmi_avi_infoframe_pack(&frame, buffer, sizeof(buffer));
459cc2c6800b54 Thierry Reding 2015-07-30  1936  	if (err < 0) {
459cc2c6800b54 Thierry Reding 2015-07-30  1937  		dev_err(sor->dev, "failed to pack AVI infoframe: %d\n", err);
459cc2c6800b54 Thierry Reding 2015-07-30  1938  		return err;
459cc2c6800b54 Thierry Reding 2015-07-30  1939  	}
459cc2c6800b54 Thierry Reding 2015-07-30  1940  
459cc2c6800b54 Thierry Reding 2015-07-30  1941  	tegra_sor_hdmi_write_infopack(sor, buffer, err);
459cc2c6800b54 Thierry Reding 2015-07-30  1942  
459cc2c6800b54 Thierry Reding 2015-07-30  1943  	/* enable AVI infoframe */
459cc2c6800b54 Thierry Reding 2015-07-30  1944  	value = tegra_sor_readl(sor, SOR_HDMI_AVI_INFOFRAME_CTRL);
459cc2c6800b54 Thierry Reding 2015-07-30  1945  	value |= INFOFRAME_CTRL_CHECKSUM_ENABLE;
459cc2c6800b54 Thierry Reding 2015-07-30  1946  	value |= INFOFRAME_CTRL_ENABLE;
459cc2c6800b54 Thierry Reding 2015-07-30  1947  	tegra_sor_writel(sor, value, SOR_HDMI_AVI_INFOFRAME_CTRL);
459cc2c6800b54 Thierry Reding 2015-07-30  1948  
459cc2c6800b54 Thierry Reding 2015-07-30  1949  	return 0;
459cc2c6800b54 Thierry Reding 2015-07-30  1950  }
459cc2c6800b54 Thierry Reding 2015-07-30  1951  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#2 lore raw

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

In reply to Jani Nikula

Reduce the need for rebuilds when drm_edid.h is modified by including it only where needed.

v2: Fix build (kernel test robot <[email protected]>)

---
 drivers/gpu/drm/tegra/drm.h    | 2 +-
 drivers/gpu/drm/tegra/output.c | 1 +
 drivers/gpu/drm/tegra/sor.c    | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/tegra/drm.h +1 -1
index ccb5d74fa227..682011166a8f 100644
@@ -13,7 +13,6 @@
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_bridge.h>
-#include <drm/drm_edid.h>
 #include <drm/drm_encoder.h>
 #include <drm/drm_fixed.h>
 #include <drm/drm_probe_helper.h>
@@ -26,6 +25,7 @@
 /* XXX move to include/uapi/drm/drm_fourcc.h? */
 #define DRM_FORMAT_MOD_NVIDIA_SECTOR_LAYOUT BIT_ULL(22)
 
+struct edid;
 struct reset_control;
 
 struct tegra_drm {
drivers/gpu/drm/tegra/output.c +1 -0
index dc2dcb5ca1c8..88af956ad0e7 100644
@@ -8,6 +8,7 @@
 #include <linux/of.h>
 
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_edid.h>
 #include <drm/drm_of.h>
 #include <drm/drm_panel.h>
 #include <drm/drm_simple_kms_helper.h>
drivers/gpu/drm/tegra/sor.c +1 -0
index 83341576630d..bad3b8fcc726 100644
@@ -20,6 +20,7 @@
 #include <drm/display/drm_scdc_helper.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_debugfs.h>
+#include <drm/drm_edid.h>
 #include <drm/drm_eld.h>
 #include <drm/drm_file.h>
 #include <drm/drm_panel.h>
Signature · 1 line
2.39.2
#3 lore raw
Quoted 11 lines · Jani Nikula

Reduce the need for rebuilds when drm_edid.h is modified by including it only where needed.

v2: Fix build (kernel test robot <[email protected]>)

---
 drivers/gpu/drm/tegra/drm.h    | 2 +-
 drivers/gpu/drm/tegra/output.c | 1 +
 drivers/gpu/drm/tegra/sor.c    | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

Applied, thanks.

Thierry