[PATCH i-g-t v4] tools/intel_dp_compliance: Enabling XE driver support

Kamil Konieczny kamil.konieczny at linux.intel.com
Mon Jul 28 08:41:35 UTC 2025


Hi Disantkumar,
On 2025-07-24 at 10:53:39 +0530, Disantkumar Mistry wrote:
> i915 and XE driver have different api for mapping buffer. Enabling XE
> driver support by using igt_fb_map_buffer function which call mapping
> buffer api based on device type.
> 
> Signed-off-by: Disantkumar Mistry <disantkumar.isvarbhai.mistry at intel.com>
> Tested-by: Khaled Almahallawy <khaled.almahallawy at intel.com>
> -----------

Please use only three '-' chars here, like:

---

so later on git will drop these version notes.
This could be done at merge, no need for resend.

Regards,
Kamil

> v2 - Fixed Alignment (Kamil)
> v3 - Utilizing existing lib function igt_fb_map_buffer (Syrjälä)
> v4 - updating version history (Swati)
> -----------
> ---
>  tools/intel_dp_compliance.c | 22 +++-------------------
>  1 file changed, 3 insertions(+), 19 deletions(-)
> 
> diff --git a/tools/intel_dp_compliance.c b/tools/intel_dp_compliance.c
> index 99196a450b45..31572f6c3ebc 100644
> --- a/tools/intel_dp_compliance.c
> +++ b/tools/intel_dp_compliance.c
> @@ -361,15 +361,10 @@ static int setup_framebuffers(struct connector *dp_conn)
>  	igt_assert(dp_conn->fb);
>  
>  	/* Map the mapping of GEM object into the virtual address space */
> -	dp_conn->pixmap = gem_mmap__device_coherent(drm_fd,
> -					dp_conn->fb_video_pattern.gem_handle,
> -					0, dp_conn->fb_video_pattern.size,
> -					PROT_READ | PROT_WRITE);
> +	dp_conn->pixmap = igt_fb_map_buffer(drm_fd, &dp_conn->fb_video_pattern);
>  	if (dp_conn->pixmap == NULL)
>  		return -1;
>  
> -	gem_set_domain(drm_fd, dp_conn->fb_video_pattern.gem_handle,
> -		       I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
>  	dp_conn->fb_size = dp_conn->fb_video_pattern.size;
>  
>  	/* After filling the device memory with 0s it needs to be unmapped */
> @@ -391,15 +386,10 @@ static int setup_failsafe_framebuffer(struct connector *dp_conn)
>  	igt_assert(dp_conn->failsafe_fb);
>  
>  	/* Map the mapping of GEM object into the virtual address space */
> -	dp_conn->failsafe_pixmap = gem_mmap__device_coherent(drm_fd,
> -						 dp_conn->fb_failsafe_pattern.gem_handle,
> -						 0, dp_conn->fb_failsafe_pattern.size,
> -						 PROT_READ | PROT_WRITE);
> +	dp_conn->failsafe_pixmap = igt_fb_map_buffer(drm_fd, &dp_conn->fb_failsafe_pattern);
>  	if (dp_conn->failsafe_pixmap == NULL)
>  		return -1;
>  
> -	gem_set_domain(drm_fd, dp_conn->fb_failsafe_pattern.gem_handle,
> -		       I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
>  	dp_conn->failsafe_size = dp_conn->fb_failsafe_pattern.size;
>  
>  	/* After filling the device framebuffer the mapped memory needs to be freed */
> @@ -428,16 +418,10 @@ static int setup_video_pattern_framebuffer(struct connector *dp_conn)
>  	igt_assert(dp_conn->test_pattern.fb);
>  
>  	/* Map the mapping of GEM object into the virtual address space */
> -	dp_conn->test_pattern.pixmap = gem_mmap__device_coherent(drm_fd,
> -						     dp_conn->test_pattern.fb_pattern.gem_handle,
> -						     0, dp_conn->test_pattern.fb_pattern.size,
> -						     PROT_READ | PROT_WRITE);
> +	dp_conn->test_pattern.pixmap = igt_fb_map_buffer(drm_fd, &dp_conn->test_pattern.fb_pattern);
>  	if (dp_conn->test_pattern.pixmap == NULL)
>  		return -1;
>  
> -	gem_set_domain(drm_fd, dp_conn->test_pattern.fb_pattern.gem_handle,
> -		       I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
> -
>  	dp_conn->test_pattern.size = dp_conn->test_pattern.fb_pattern.size;
>  
>  	memset(dp_conn->test_pattern.pixmap, 0, dp_conn->test_pattern.size);
> -- 
> 2.49.0
> 


More information about the igt-dev mailing list