All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Rob Clark <rob.clark@linaro.org>
Cc: Rob Clark <rob@ti.com>,
	dri-devel@lists.freedesktop.org, patches@linaro.org
Subject: Re: [PATCH RFC 1/2] drm: add bitmask property type
Date: Fri, 30 Mar 2012 13:37:23 +0300	[thread overview]
Message-ID: <20120330103723.GW4917@intel.com> (raw)
In-Reply-To: <CAF6AEGuA9b1frhc8MA7WXMTBqOVPXKBQ=bcnKce96f_B6cJbvA@mail.gmail.com>

On Thu, Mar 29, 2012 at 08:15:48PM -0500, Rob Clark wrote:
> On Thu, Mar 29, 2012 at 8:02 PM, Rob Clark <rob.clark@linaro.org> wrote:
> > From: Rob Clark <rob@ti.com>
> >
> > A bitmask property is similar to an enum.  The enum value is a bit
> > position (0-63), and valid property values consist of a mask of
> > zero or more of (1 << enum_val[n]).
> >
> > TODO: word commit msg better
> > TODO: maybe "flags" would be a better name for the property type?
> > ---
> > See https://github.com/robclark/kernel-omap4/commit/970b7bb95993fc43b4977976bf8005dc2e1a4ad3#L6R411
> > for an example usage.  In this case combinations of "x-invert", "y-invert"
> > and "xy-flip" can express all possible combinations of rotations of
> > multiples of 90 degrees plus mirroring.  Which is sufficient for an
> > xrandr v1.2 rotation support.  For arbitrary transforms in xrandr v1.3
> > a different property with a transform matrix (if supported by the
> > driver) should be used.
> 
> oh, and this shows the mapping between xrandr rotation/reflection mask
> and x-invert/y-invert/xy-flip:
> https://github.com/robclark/xf86-video-omap/commit/87ffbaf9d282831bf03da457e6f6c4e45a0d6b2b#L0R222
> 
> The other option is of course to make the rotation bitmask mirror the
> xrandr rotation mask values, which might be a better option to support
> drivers which only provide rotation and not mirroring.  I'm ok with
> either option, whatever others prefer.

I would prefer something like that, but we shouldn't just blindly copy
the exact bit definitions. The xrandr reflection vs. rotation always
seemed to be backwards to me. To me it feels more natural to first
rotate, and then reflect/mirror. But it could be that I've just been
influenced by specific hardware designs.


Now that there seems to be a spur of activity in the property area,
could we come up with some way to better control what properties get
added, and how they're defined. Currently every driver is free to
define whatever ad-hoc properties they wish.

I would suggest we either A) define some namespace for standard
properties, or B) introduce some new property mechanism that actually
uses integer property IDs. In either case new properties or changes to
existing standard properties should be carefully reviewed. I'm sort of
partial to option B, since doing a gazillion string comparisons when
pushing lots of properties to the driver seems like a pointless
waste of cycles. OTOH option A seems a little less revolutionary.

In any case, the current mess just doesn't allow any kind of truly
generic user space code to be written.

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2012-03-30 10:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-30  1:02 [PATCH RFC 1/2] drm: add bitmask property type Rob Clark
2012-03-30  1:02 ` [PATCH RFC 2/2] drm: add plane properties Rob Clark
2012-03-30  1:15 ` [PATCH RFC 1/2] drm: add bitmask property type Rob Clark
2012-03-30 10:37   ` Ville Syrjälä [this message]
2012-03-30 11:00     ` Marcus Lorentzon
2012-03-30 12:25     ` Rob Clark
2012-03-30 16:59     ` Paulo Zanoni
2012-03-30 17:16       ` Paulo Zanoni
2012-03-30  8:44 ` Chris Wilson

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=20120330103723.GW4917@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=patches@linaro.org \
    --cc=rob.clark@linaro.org \
    --cc=rob@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.