From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH igt 1/2] lib: Add igt_plane_set_size() Date: Tue, 30 Sep 2014 14:56:11 +0200 Message-ID: <20140930125611.GN24667@phenom.ffwll.local> References: <1410547094-22877-1-git-send-email-ville.syrjala@linux.intel.com> <20140915091711.GO4740@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by gabe.freedesktop.org (Postfix) with ESMTP id A72256FB87 for ; Tue, 30 Sep 2014 05:56:15 -0700 (PDT) Received: by mail-wg0-f52.google.com with SMTP id n12so13442064wgh.35 for ; Tue, 30 Sep 2014 05:56:14 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140915091711.GO4740@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: ville.syrjala@linux.intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, Sep 15, 2014 at 11:17:11AM +0200, Daniel Vetter wrote: > On Fri, Sep 12, 2014 at 09:38:13PM +0300, ville.syrjala@linux.intel.com w= rote: > > From: Ville Syrj=E4l=E4 > > = > > 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 ... Ping for documentation. -Daniel > = > Thanks, Daniel > > = > > Signed-off-by: Ville Syrj=E4l=E4 > > --- > > 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 *plan= e, > > 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 =3D 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 =3D fb; > > + /* hack to keep tests working that don't call igt_plane_set_size() */ > > + if (fb) { > > + plane->crtc_w =3D fb->width; > > + plane->crtc_h =3D fb->height; > > + } else { > > + plane->crtc_w =3D 0; > > + plane->crtc_h =3D 0; > > + } > > = > > plane->fb_changed =3D true; > > } > > @@ -1649,6 +1657,24 @@ void igt_plane_set_position(igt_plane_t *plane, = int x, int y) > > plane->position_changed =3D true; > > } > > = > > +void igt_plane_set_size(igt_plane_t *plane, int w, int h) > > +{ > > + igt_pipe_t *pipe =3D plane->pipe; > > + igt_display_t *display =3D pipe->display; > > + > > + LOG(display, "%s.%d: plane_set_size(%d,%d)\n", > > + kmstest_pipe_name(pipe->pipe), plane->index, w, h); > > + > > + plane->crtc_w =3D w; > > + plane->crtc_h =3D h; > > + > > + /* > > + * must be fb_changed so that legacy cursors call > > + * drmModeSetCursor() instead of drmModeMoveCursor() > > + */ > > + plane->fb_changed =3D true; > > +} > > + > > void igt_plane_set_panning(igt_plane_t *plane, int x, int y) > > { > > igt_pipe_t *pipe =3D 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 rotatio= n); > > = > > -- = > > 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 -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch