From mboxrd@z Thu Jan 1 00:00:00 1970 From: Damien Lespiau Subject: Re: [PATCH i-g-t 05/43] igt_kms: Add support for setting plane rotation Date: Fri, 11 Jul 2014 15:16:18 +0100 Message-ID: <20140711141618.GD8230@strange.amr.corp.intel.com> References: <1405015244-11370-1-git-send-email-damien.lespiau@intel.com> <1405015244-11370-6-git-send-email-damien.lespiau@intel.com> <20140711063742.GS17271@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 117FD6E844 for ; Fri, 11 Jul 2014 07:16:26 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140711063742.GS17271@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: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Jul 11, 2014 at 08:37:42AM +0200, Daniel Vetter wrote: > On Thu, Jul 10, 2014 at 07:00:06PM +0100, Damien Lespiau wrote: > > Signed-off-by: Damien Lespiau > > --- > > lib/igt_kms.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > lib/igt_kms.h | 11 +++++++++++ > > 2 files changed, 65 insertions(+) > > > > diff --git a/lib/igt_kms.c b/lib/igt_kms.c > > index 87f5109..69f9977 100644 > > --- a/lib/igt_kms.c > > +++ b/lib/igt_kms.c > > @@ -537,6 +537,16 @@ get_plane_property(igt_display_t *display, uint32_t plane_id, const char *name, > > name, prop_id, value); > > } > > > > +static void > > +igt_plane_set_property(igt_plane_t *plane, uint32_t prop_id, uint64_t value) > > +{ > > + igt_pipe_t *pipe = plane->pipe; > > + igt_display_t *display = pipe->display; > > + > > + drmModeObjectSetProperty(display->drm_fd, plane->drm_plane->plane_id, > > + DRM_MODE_OBJECT_PLANE, prop_id, value); > > +} > > I wonder whether we shouldn't have interfaces using the property names and > maybe for enum properties also the strings and let igt do it's thing. But > as long as this is just an internal function it should be good enough. That'd be handy. the only issue is that you'd have to do a lookup of the property id each time or create a prop_name -> prop_id map in the different objects. Also, we can provide a bit more typing than a uint64_t for the value. Trade-offs, trade-offs, ... -- Damien