Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH igt 1/2] lib: Add igt_plane_set_size()
Date: Mon, 15 Sep 2014 11:17:11 +0200	[thread overview]
Message-ID: <20140915091711.GO4740@phenom.ffwll.local> (raw)
In-Reply-To: <1410547094-22877-1-git-send-email-ville.syrjala@linux.intel.com>

On Fri, Sep 12, 2014 at 09:38:13PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Allow tests to specify the plane size instead of assuming that the
> entire FB will be scanned out.
> 
> To keep the current tests working without having to sprinkle
> igt_plane_set_size() calls all over the place, make
> igt_plane_set_fb() reset the plane size to the FB size.

Can you please add gtkdoc for just these two functions? We need to start
somewhere ...

Thanks, Daniel
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  lib/igt_kms.c | 34 ++++++++++++++++++++++++++++++----
>  lib/igt_kms.h |  3 +++
>  2 files changed, 33 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 3a850f1..0547147 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1269,7 +1269,7 @@ static int igt_drm_plane_commit(igt_plane_t *plane,
>  				      fb_id,
>  				      0,    /* flags */
>  				      plane->crtc_x, plane->crtc_y,
> -				      plane->fb->width, plane->fb->height,
> +				      plane->crtc_w, plane->crtc_h,
>  				      IGT_FIXED(0,0), /* src_x */
>  				      IGT_FIXED(0,0), /* src_y */
>  				      IGT_FIXED(plane->fb->width,0), /* src_w */
> @@ -1314,12 +1314,12 @@ static int igt_cursor_commit_legacy(igt_plane_t *cursor,
>  			    igt_output_name(output),
>  			    kmstest_pipe_name(output->config.pipe),
>  			    gem_handle,
> -			    cursor->fb->width, cursor->fb->height);
> +			    cursor->crtc_w, cursor->crtc_h);
>  
>  			ret = drmModeSetCursor(display->drm_fd, crtc_id,
>  					       gem_handle,
> -					       cursor->fb->width,
> -					       cursor->fb->height);
> +					       cursor->crtc_w,
> +					       cursor->crtc_h);
>  		} else {
>  			LOG(display,
>  			    "%s: SetCursor pipe %s, disabling\n",
> @@ -1631,6 +1631,14 @@ void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb)
>  	    plane->index, fb ? fb->fb_id : 0);
>  
>  	plane->fb = fb;
> +	/* hack to keep tests working that don't call igt_plane_set_size() */
> +	if (fb) {
> +		plane->crtc_w = fb->width;
> +		plane->crtc_h = fb->height;
> +	} else {
> +		plane->crtc_w = 0;
> +		plane->crtc_h = 0;
> +	}
>  
>  	plane->fb_changed = true;
>  }
> @@ -1649,6 +1657,24 @@ void igt_plane_set_position(igt_plane_t *plane, int x, int y)
>  	plane->position_changed = true;
>  }
>  
> +void igt_plane_set_size(igt_plane_t *plane, int w, int h)
> +{
> +	igt_pipe_t *pipe = plane->pipe;
> +	igt_display_t *display = pipe->display;
> +
> +	LOG(display, "%s.%d: plane_set_size(%d,%d)\n",
> +	    kmstest_pipe_name(pipe->pipe), plane->index, w, h);
> +
> +	plane->crtc_w = w;
> +	plane->crtc_h = h;
> +
> +	/*
> +	 * must be fb_changed so that legacy cursors call
> +	 * drmModeSetCursor() instead of drmModeMoveCursor()
> +	 */
> +	plane->fb_changed = true;
> +}
> +
>  void igt_plane_set_panning(igt_plane_t *plane, int x, int y)
>  {
>  	igt_pipe_t *pipe = plane->pipe;
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 921afef..027b4e0 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -212,6 +212,8 @@ typedef struct {
>  
>  	/* position within pipe_src_w x pipe_src_h */
>  	int crtc_x, crtc_y;
> +	/* size within pipe_src_w x pipe_src_h */
> +	int crtc_w, crtc_h;
>  	/* panning offset within the fb */
>  	unsigned int pan_x, pan_y;
>  	igt_rotation_t rotation;
> @@ -266,6 +268,7 @@ static inline bool igt_plane_supports_rotation(igt_plane_t *plane)
>  
>  void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb);
>  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_panning(igt_plane_t *plane, int x, int y);
>  void igt_plane_set_rotation(igt_plane_t *plane, igt_rotation_t rotation);
>  
> -- 
> 1.8.5.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  parent reply	other threads:[~2014-09-15  9:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 18:38 [PATCH igt 1/2] lib: Add igt_plane_set_size() ville.syrjala
2014-09-12 18:38 ` [PATCH igt 2/2] tests/kms_cursor_crc: Add basic non-square cursor testing ville.syrjala
2014-09-15  9:17 ` Daniel Vetter [this message]
2014-09-30 12:56   ` [PATCH igt 1/2] lib: Add igt_plane_set_size() Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140915091711.GO4740@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox