[Intel-gfx] [PATCH i-g-t v2 11/14] lib/igt_kms: Remove igt_crtc_set_background()

Mika Kahola mika.kahola at intel.com
Fri Oct 20 06:33:46 UTC 2017


Reviewed-by: Mika Kahola <mika.kahola at intel.com>

On Thu, 2017-10-12 at 13:54 +0200, Maarten Lankhorst wrote:
> This can be handled by generic properties.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> ---
>  lib/igt_kms.c                     | 21 ---------------------
>  lib/igt_kms.h                     |  1 -
>  tests/kms_crtc_background_color.c | 18 +++++++++---------
>  3 files changed, 9 insertions(+), 31 deletions(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 70b104b24f8d..9cf4b68f4191 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -3227,27 +3227,6 @@ void igt_pipe_request_out_fence(igt_pipe_t
> *pipe)
>  	igt_pipe_obj_set_prop_value(pipe, IGT_CRTC_OUT_FENCE_PTR,
> (ptrdiff_t)&pipe->out_fence_fd);
>  }
>  
> -/**
> - * igt_crtc_set_background:
> - * @pipe: pipe pointer to which background color to be set
> - * @background: background color value in BGR 16bpc
> - *
> - * Sets background color for requested pipe. Color value provided
> here
> - * will be actually submitted at output commit time via
> "background_color"
> - * property.
> - * For example to get red as background, set background =
> 0x00000000FFFF.
> - */
> -void igt_crtc_set_background(igt_pipe_t *pipe, uint64_t background)
> -{
> -	igt_display_t *display = pipe->display;
> -
> -	LOG(display, "%s.%d: crtc_set_background(%"PRIx64")\n",
> -	    kmstest_pipe_name(pipe->pipe),
> -	    pipe->pipe, background);
> -
> -	igt_pipe_obj_set_prop_value(pipe, IGT_CRTC_BACKGROUND,
> background);
> -}
> -
>  void igt_wait_for_vblank_count(int drm_fd, enum pipe pipe, int
> count)
>  {
>  	drmVBlank wait_vbl;
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index dbba0cd53a25..e722f0be3757 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -378,7 +378,6 @@ void igt_plane_set_fence_fd(igt_plane_t *plane,
> int fence_fd);
>  void igt_plane_set_position(igt_plane_t *plane, int x, int y);
>  void igt_plane_set_size(igt_plane_t *plane, int w, int h);
>  void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t
> rotation);
> -void igt_crtc_set_background(igt_pipe_t *pipe, uint64_t background);
>  void igt_fb_set_position(struct igt_fb *fb, igt_plane_t *plane,
>  	uint32_t x, uint32_t y);
>  void igt_fb_set_size(struct igt_fb *fb, igt_plane_t *plane,
> diff --git a/tests/kms_crtc_background_color.c
> b/tests/kms_crtc_background_color.c
> index 414cc82f3e8b..6edb8de3bb24 100644
> --- a/tests/kms_crtc_background_color.c
> +++ b/tests/kms_crtc_background_color.c
> @@ -97,7 +97,7 @@ static void prepare_crtc(data_t *data, igt_output_t
> *output, enum pipe pipe,
>  	igt_assert(fb_id);
>  
>  	/* To make FB pixel win with background color, set alpha as
> full opaque */
> -	igt_crtc_set_background(plane->pipe, pipe_background_color);
> +	igt_pipe_set_prop_value(display, pipe, IGT_CRTC_BACKGROUND,
> pipe_background_color);
>  	if (opaque_buffer)
>  		alpha = 1.0;    /* alpha 1 is fully opque */
>  	else
> @@ -117,7 +117,7 @@ static void cleanup_crtc(data_t *data,
> igt_output_t *output, igt_plane_t *plane)
>  
>  	igt_remove_fb(data->gfx_fd, &data->fb);
>  
> -	igt_crtc_set_background(plane->pipe, BLACK64);
> +	igt_pipe_obj_set_prop_value(plane->pipe,
> IGT_CRTC_BACKGROUND, BLACK64);
>  	igt_plane_set_fb(plane, NULL);
>  	igt_output_set_pipe(output, PIPE_ANY);
>  
> @@ -144,26 +144,26 @@ static void test_crtc_background(data_t *data)
>  		/* Now set background without using a plane, i.e.,
>  		 * Disable the plane to let hw background color win
> blend. */
>  		igt_plane_set_fb(plane, NULL);
> -		igt_crtc_set_background(plane->pipe, PURPLE64);
> +		igt_pipe_set_prop_value(display, pipe,
> IGT_CRTC_BACKGROUND, PURPLE64);
>  		igt_display_commit2(display, COMMIT_UNIVERSAL);
>  
>  		/* Try few other background colors */
> -		igt_crtc_set_background(plane->pipe, CYAN64);
> +		igt_pipe_set_prop_value(display, pipe,
> IGT_CRTC_BACKGROUND, CYAN64);
>  		igt_display_commit2(display, COMMIT_UNIVERSAL);
>  
> -		igt_crtc_set_background(plane->pipe, YELLOW64);
> +		igt_pipe_set_prop_value(display, pipe,
> IGT_CRTC_BACKGROUND, YELLOW64);
>  		igt_display_commit2(display, COMMIT_UNIVERSAL);
>  
> -		igt_crtc_set_background(plane->pipe, RED64);
> +		igt_pipe_set_prop_value(display, pipe,
> IGT_CRTC_BACKGROUND, RED64);
>  		igt_display_commit2(display, COMMIT_UNIVERSAL);
>  
> -		igt_crtc_set_background(plane->pipe, GREEN64);
> +		igt_pipe_set_prop_value(display, pipe,
> IGT_CRTC_BACKGROUND, GREEN64);
>  		igt_display_commit2(display, COMMIT_UNIVERSAL);
>  
> -		igt_crtc_set_background(plane->pipe, BLUE64);
> +		igt_pipe_set_prop_value(display, pipe,
> IGT_CRTC_BACKGROUND, BLUE64);
>  		igt_display_commit2(display, COMMIT_UNIVERSAL);
>  
> -		igt_crtc_set_background(plane->pipe, WHITE64);
> +		igt_pipe_set_prop_value(display, pipe,
> IGT_CRTC_BACKGROUND, WHITE64);
>  		igt_display_commit2(display, COMMIT_UNIVERSAL);
>  
>  		valid_tests++;
-- 
Mika Kahola - Intel OTC



More information about the Intel-gfx mailing list