diff mbox series

[2/9] drm/xe/display: Add intel_plane_initial_vblank_wait

Message ID 20241105121857.17389-2-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/9] drm/xe: Remove double pageflip | expand

Commit Message

Maarten Lankhorst Nov. 5, 2024, 12:18 p.m. UTC
We're changing the driver to have no interrupts during early init for
Xe, so we poll the PIPE_FRMSTMSMP counter instead.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c  |  6 +++---
 .../drm/i915/display/intel_plane_initial.c    |  9 ++++++++-
 .../drm/i915/display/intel_plane_initial.h    |  1 +
 drivers/gpu/drm/xe/display/xe_plane_initial.c | 19 ++++++++++++++++++-
 4 files changed, 30 insertions(+), 5 deletions(-)

Comments

kernel test robot Nov. 5, 2024, 3:47 p.m. UTC | #1
Hi Maarten,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-xe/drm-xe-next]
[also build test ERROR on next-20241105]
[cannot apply to linus/master drm-intel/for-linux-next drm-intel/for-linux-next-fixes drm-tip/drm-tip v6.12-rc6]
[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/Maarten-Lankhorst/drm-xe-display-Add-intel_plane_initial_vblank_wait/20241105-202047
base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link:    https://lore.kernel.org/r/20241105121857.17389-2-maarten.lankhorst%40linux.intel.com
patch subject: [PATCH 2/9] drm/xe/display: Add intel_plane_initial_vblank_wait
config: x86_64-rhel-8.3 (https://download.01.org/0day-ci/archive/20241105/202411052327.1vYXqtrV-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241105/202411052327.1vYXqtrV-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411052327.1vYXqtrV-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

>> drivers/gpu/drm/i915/display/intel_plane_initial.c:17:1: warning: parameter names (without types) in function declaration
      17 | void intel_plane_initial_vblank_wait(plane);(struct intel_plane *plane)
         | ^~~~
>> drivers/gpu/drm/i915/display/intel_plane_initial.c:17:46: error: expected identifier or '(' before 'struct'
      17 | void intel_plane_initial_vblank_wait(plane);(struct intel_plane *plane)
         |                                              ^~~~~~
   drivers/gpu/drm/i915/display/intel_plane_initial.c: In function 'intel_initial_plane_config':
>> drivers/gpu/drm/i915/display/intel_plane_initial.c:448:25: error: implicit declaration of function 'intel_initial_vblank_wait'; did you mean 'intel_plane_initial_vblank_wait'? [-Werror=implicit-function-declaration]
     448 |                         intel_initial_vblank_wait(crtc);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
         |                         intel_plane_initial_vblank_wait
   cc1: some warnings being treated as errors


vim +17 drivers/gpu/drm/i915/display/intel_plane_initial.c

    16	
  > 17	void intel_plane_initial_vblank_wait(plane);(struct intel_plane *plane)
    18	{
    19		struct intel_crtc *crtc = intel_crtc_for_pipe(to_intel_display(plane), plane->pipe);
    20	
    21		intel_crtc_wait_for_next_vblank(crtc);
    22	}
    23
kernel test robot Nov. 5, 2024, 8:48 p.m. UTC | #2
Hi Maarten,

kernel test robot noticed the following build errors:

[auto build test ERROR on drm-xe/drm-xe-next]
[also build test ERROR on next-20241105]
[cannot apply to linus/master drm-intel/for-linux-next drm-intel/for-linux-next-fixes drm-tip/drm-tip v6.12-rc6]
[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/Maarten-Lankhorst/drm-xe-display-Add-intel_plane_initial_vblank_wait/20241105-202047
base:   https://gitlab.freedesktop.org/drm/xe/kernel.git drm-xe-next
patch link:    https://lore.kernel.org/r/20241105121857.17389-2-maarten.lankhorst%40linux.intel.com
patch subject: [PATCH 2/9] drm/xe/display: Add intel_plane_initial_vblank_wait
config: i386-defconfig (https://download.01.org/0day-ci/archive/20241106/202411060402.TB3RmJ09-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241106/202411060402.TB3RmJ09-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411060402.TB3RmJ09-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/gpu/drm/i915/display/intel_plane_initial.c:8:
   In file included from drivers/gpu/drm/i915/i915_drv.h:40:
   In file included from drivers/gpu/drm/i915/display/intel_display_core.h:16:
   In file included from include/drm/drm_connector.h:32:
   In file included from include/drm/drm_util.h:36:
   In file included from include/linux/kgdb.h:19:
   In file included from include/linux/kprobes.h:28:
   In file included from include/linux/ftrace.h:13:
   In file included from include/linux/kallsyms.h:13:
   In file included from include/linux/mm.h:2213:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/gpu/drm/i915/display/intel_plane_initial.c:17:38: error: a parameter list without types is only allowed in a function definition
      17 | void intel_plane_initial_vblank_wait(plane);(struct intel_plane *plane)
         |                                      ^
>> drivers/gpu/drm/i915/display/intel_plane_initial.c:17:46: error: expected identifier or '('
      17 | void intel_plane_initial_vblank_wait(plane);(struct intel_plane *plane)
         |                                              ^
>> drivers/gpu/drm/i915/display/intel_plane_initial.c:17:46: error: expected ')'
   drivers/gpu/drm/i915/display/intel_plane_initial.c:17:45: note: to match this '('
      17 | void intel_plane_initial_vblank_wait(plane);(struct intel_plane *plane)
         |                                             ^
>> drivers/gpu/drm/i915/display/intel_plane_initial.c:448:4: error: call to undeclared function 'intel_initial_vblank_wait'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     448 |                         intel_initial_vblank_wait(crtc);
         |                         ^
   drivers/gpu/drm/i915/display/intel_plane_initial.c:448:4: note: did you mean 'intel_plane_initial_vblank_wait'?
   drivers/gpu/drm/i915/display/intel_plane_initial.h:11:6: note: 'intel_plane_initial_vblank_wait' declared here
      11 | void intel_plane_initial_vblank_wait(struct intel_plane *plane);
         |      ^
   1 warning and 4 errors generated.


vim +17 drivers/gpu/drm/i915/display/intel_plane_initial.c

    16	
  > 17	void intel_plane_initial_vblank_wait(plane);(struct intel_plane *plane)
    18	{
    19		struct intel_crtc *crtc = intel_crtc_for_pipe(to_intel_display(plane), plane->pipe);
    20	
    21		intel_crtc_wait_for_next_vblank(crtc);
    22	}
    23
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 863927f429aa7..029a8583b0548 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -795,7 +795,7 @@  void intel_plane_disable_noatomic(struct intel_crtc *crtc,
 	if ((crtc_state->active_planes & ~BIT(PLANE_CURSOR)) == 0 &&
 	    hsw_ips_disable(crtc_state)) {
 		crtc_state->ips_enabled = false;
-		intel_crtc_wait_for_next_vblank(crtc);
+		intel_plane_initial_vblank_wait(plane);
 	}
 
 	/*
@@ -809,7 +809,7 @@  void intel_plane_disable_noatomic(struct intel_crtc *crtc,
 	 */
 	if (HAS_GMCH(dev_priv) &&
 	    intel_set_memory_cxsr(dev_priv, false))
-		intel_crtc_wait_for_next_vblank(crtc);
+		intel_plane_initial_vblank_wait(plane);
 
 	/*
 	 * Gen2 reports pipe underruns whenever all planes are disabled.
@@ -819,7 +819,7 @@  void intel_plane_disable_noatomic(struct intel_crtc *crtc,
 		intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, false);
 
 	intel_plane_disable_arm(NULL, plane, crtc_state);
-	intel_crtc_wait_for_next_vblank(crtc);
+	intel_plane_initial_vblank_wait(plane);
 }
 
 unsigned int
diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.c b/drivers/gpu/drm/i915/display/intel_plane_initial.c
index 62401f6a04e4f..f0f4ec2b6cc98 100644
--- a/drivers/gpu/drm/i915/display/intel_plane_initial.c
+++ b/drivers/gpu/drm/i915/display/intel_plane_initial.c
@@ -14,6 +14,13 @@ 
 #include "intel_frontbuffer.h"
 #include "intel_plane_initial.h"
 
+void intel_plane_initial_vblank_wait(plane);(struct intel_plane *plane)
+{
+	struct intel_crtc *crtc = intel_crtc_for_pipe(to_intel_display(plane), plane->pipe);
+
+	intel_crtc_wait_for_next_vblank(crtc);
+}
+
 static bool
 intel_reuse_initial_plane_obj(struct intel_crtc *this,
 			      const struct intel_initial_plane_config plane_configs[],
@@ -438,7 +445,7 @@  void intel_initial_plane_config(struct drm_i915_private *i915)
 		intel_find_initial_plane_obj(crtc, plane_configs);
 
 		if (i915->display.funcs.display->fixup_initial_plane_config(crtc, plane_config))
-			intel_crtc_wait_for_next_vblank(crtc);
+			intel_initial_vblank_wait(crtc);
 
 		plane_config_fini(plane_config);
 	}
diff --git a/drivers/gpu/drm/i915/display/intel_plane_initial.h b/drivers/gpu/drm/i915/display/intel_plane_initial.h
index 64ab95239cd45..3ba20b9e2355f 100644
--- a/drivers/gpu/drm/i915/display/intel_plane_initial.h
+++ b/drivers/gpu/drm/i915/display/intel_plane_initial.h
@@ -8,6 +8,7 @@ 
 
 struct drm_i915_private;
 
+void intel_plane_initial_vblank_wait(struct intel_plane *plane);
 void intel_initial_plane_config(struct drm_i915_private *i915);
 
 #endif
diff --git a/drivers/gpu/drm/xe/display/xe_plane_initial.c b/drivers/gpu/drm/xe/display/xe_plane_initial.c
index 668f544a7ac80..9252cfeef0a1f 100644
--- a/drivers/gpu/drm/xe/display/xe_plane_initial.c
+++ b/drivers/gpu/drm/xe/display/xe_plane_initial.c
@@ -8,7 +8,9 @@ 
 
 #include "regs/xe_gtt_defs.h"
 #include "xe_ggtt.h"
+#include "xe_mmio.h"
 
+#include "i915_reg.h"
 #include "intel_atomic_plane.h"
 #include "intel_crtc.h"
 #include "intel_display.h"
@@ -22,6 +24,21 @@ 
 
 #include <generated/xe_wa_oob.h>
 
+void intel_plane_initial_vblank_wait(struct intel_plane *plane)
+{
+	/* Early xe has no irq */
+	struct xe_device *xe = to_xe_device(plane->base.dev);
+	struct xe_reg pipe_frmtmstmp = XE_REG(i915_mmio_reg_offset(PIPE_FRMTMSTMP(plane->pipe)));
+	u32 timestamp;
+	int ret;
+
+	timestamp = xe_mmio_read32(xe_root_tile_mmio(xe), pipe_frmtmstmp);
+
+	ret = xe_mmio_wait32_not(xe_root_tile_mmio(xe), pipe_frmtmstmp, ~0U, timestamp, 40000U, &timestamp, false);
+	if (ret < 0)
+		drm_warn(&xe->drm, "waiting for early vblank failed with %i\n", ret);
+}
+
 static bool
 intel_reuse_initial_plane_obj(struct intel_crtc *this,
 			      const struct intel_initial_plane_config plane_configs[],
@@ -293,7 +310,7 @@  void intel_initial_plane_config(struct drm_i915_private *i915)
 		intel_find_initial_plane_obj(crtc, plane_configs);
 
 		if (i915->display.funcs.display->fixup_initial_plane_config(crtc, plane_config))
-			intel_crtc_wait_for_next_vblank(crtc);
+			intel_plane_initial_vblank_wait(to_intel_plane(crtc->base.primary));
 
 		plane_config_fini(plane_config);
 	}