From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Rob Clark <robdclark@gmail.com>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 0/9] drm/i915: Plane rotation support
Date: Mon, 30 Sep 2013 21:31:45 +0300 [thread overview]
Message-ID: <20130930183145.GG9395@intel.com> (raw)
In-Reply-To: <CAF6AEGtzNWigMezV3ARB9Ote8dwpzLJiZSKLTr8dTWBQTSwgQQ@mail.gmail.com>
On Mon, Sep 30, 2013 at 01:46:11PM -0400, Rob Clark wrote:
> On Mon, Sep 30, 2013 at 1:09 PM, Ville Syrjälä
> <ville.syrjala@linux.intel.com> wrote:
> > On Mon, Sep 30, 2013 at 12:15:06PM -0400, Rob Clark wrote:
> >> On Mon, Sep 30, 2013 at 10:44 AM, <ville.syrjala@linux.intel.com> wrote:
> >> > Recently some people from inside Intel have showed some interest in 180
> >> > degree plane rotation. To avoid a huge mess, I decided that I should
> >> > implement the feature properly.
> >> >
> >> > So I snatched the rotation property from omapdrm, and moved some of the
> >> > code into drm_crtc.c, added a bunch of helper stuff to drm_crtc/rect
> >> > and implemented the relevant bits in i915. I didn't touch cursor or
> >> > primary planes at all. I'm sort of hoping we might do the drm_plane
> >> > conversion sometime soonish and then we'd avoid adding a bunch of
> >> > plane properties to the crtc.
> >>
> >> fwiw, I was leaning towards introducing primary-plane's visible to
> >> userspace after we have atomic modeset (or really, the
> >> propertyification associated with atomic modeset).
> >
> > Less burden of maintaining all the crtc properties if we convert to
> > drm_plane first.
> >
> >>
> >> But that should be independent of drm_plane conversion. You probably
> >> still want to do something like what I did in omapdrm where you attach
> >> plane properties on the crtc as well for benefit of old userspace.
> >
> > Dunno. There's no old userspace that would use this. There are some
> > folks inside Intel who apparently want rotation for some thing, but
> > I was thinking I'd let them add the properties on the crtc and not
> > upstream any of that.
>
> for properties that aren't actually handled by the crtc, just make
> your crtc_set_prop() call:
>
> intel_plane_set_property(intel_crtc->plane, property, val)
>
> (or something roughly like that)
Sure it's doable, but I tend to think it's rather pointless since we
don't have any legacy userspace to worry about yet.
> >>
> >> > One thing I don't really like is the current way of stuffing the bit
> >> > number into the enum_list resulting in DRM_ROTATE_FOO being just the bit
> >> > number. I'd prefer to make DRM_ROTATE_FOO the shifted bitmask. But I'm
> >> > not sure if changing that would cause grief to userspace, so I left it
> >> > alone for now.
> >>
> >> I think this shouldn't be visible to userspace. If I remember
> >> correctly, I just did it this way to make it easier to prevent users
> >> of bitmask property from doing the wrong thing (setting multiple bits,
> >> overlapping bitmask values, etc).
> >
> > Well setting multiple bits should be allowed. If it's not we need to fix
> > it since rotation+reflection sure needs it. Or did you mean users as in
> > driver code in the kernel which registers the bitmask prop?
>
> yeah, setting multiple bits is allowed.. this is why it isn't an enum
> property ;-)
>
> I meant users as in driver code rather than userspace. I guess that
> was worded a bit confusingly. I blame the cough syrup.
Right.
>
> > I also just had an idea to expose color keys, bg colors, etc. as bitmask
> > props where each channel is represented by a multi-bit mask, and the
> > whole thing is just one bitmask prop. That would expose some structure
> > to userspace w/o need a new prop type. But maybe we want a specialized
> > type for color props for extra clarty.
>
> hmm.. should the values be interpreted in terms of current attached fb format?
My current thinking is to go with a fixed 16 bits per channel, and
just throw away any low bits you don't need.
>
> >>
> >> Anyways, from a really quick look, the core and omapdrm parts look good.
> >>
> >> The drm_rotation_simplify() might be overkill.. or at least userspace
> >> should see what are the supported bitmask flags and not try to ask for
> >> something that is not supported. Or am I missing something?
> >
> > My main idea was that, for example if the hardware support X and Y reflection,
> > we can expose both 0 and 180 angles and X and Y reflection, and the driver
> > code can then do the simplification to elimnate the 180 degree case. So it's
> > just a convenience tool for the driver authors to eliminate the redundant
> > information. I didn't actually end up using it in i915 since we really
> > don't support anything but 0 and 180 cases, and advertising anything
> > else to userspace would be a bad idea.
>
> oh, right.. we do have some redundancy in rotation values. Maybe we
> should have stuck with xyflip/yinvert/xinvert (which was how the omap
> hw worked.. but seemed a bit too hw specific).
That's omap4 or omap5 i take it. Omap3 had 0,90,180,270 + x mirror for DMA
rotation, and 0+90+180+270 + y mirror for VRFB. The mismatch was
interesting since omap angle was clockwise, randr counter-clockwise, and
omap mirroring was post-rotation, randr pre-rotation.
Also the xyflip/etc. is just confusing to me, so I'm happy you went with
randr compatible specification rather than whatever your hw had.
> I guess the main thing I care about is that we don't advertise things
> to userspace that we can't actually do. I'm not sure what other hw
> out there supports rotation in hw in some form or another, but it
> might be a good time to hear from 'em about whether these property
> values work for them or not.
I think the current stuff is good. In my years I've seen hardware
that supports everything (omap), just 0+180 (intel gen4+), just
0+180+x+y (intel gen2/3 video overlay), just 0+x (matrox g200+),
just 0 (ati mach64 and r128 era stuff).
--
Ville Syrjälä
Intel OTC
prev parent reply other threads:[~2013-09-30 18:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-30 14:44 [PATCH 0/9] drm/i915: Plane rotation support ville.syrjala
2013-09-30 14:44 ` [PATCH 1/9] drm: Move DRM_ROTATE bits out of omapdrm into drm_crtc.h ville.syrjala
2013-09-30 14:44 ` [PATCH 2/9] drm: Add support_bits parameter to drm_property_create_bitmask() ville.syrjala
2013-09-30 14:44 ` [PATCH 3/9] drm: Add drm_mode_create_rotation_property() ville.syrjala
2013-09-30 14:44 ` [PATCH 4/9] drm/omap: Switch omapdrm over to drm_mode_create_rotation_property() ville.syrjala
2013-09-30 14:44 ` [PATCH 5/9] drm: Add drm_rect rotation functions ville.syrjala
2013-09-30 14:44 ` [PATCH 6/9] drm: Add drm_rotation_simplify() ville.syrjala
2013-10-14 13:46 ` [Intel-gfx] " Imre Deak
2013-10-14 13:50 ` Ville Syrjälä
2013-09-30 14:44 ` [PATCH 7/9] drm/i915: Add 180 degree sprite rotation support ville.syrjala
2013-10-01 13:22 ` [PATCH v2 " ville.syrjala
2013-09-30 14:44 ` [PATCH 8/9] drm/i915: Make intel_plane_restore() return an error ville.syrjala
2013-09-30 14:44 ` [PATCH 9/9] drm/i915: Add rotation property for sprites ville.syrjala
2013-10-14 13:59 ` Imre Deak
2013-10-14 14:39 ` Ville Syrjälä
2013-10-14 15:10 ` Imre Deak
2013-09-30 16:15 ` [PATCH 0/9] drm/i915: Plane rotation support Rob Clark
2013-09-30 17:09 ` Ville Syrjälä
2013-09-30 17:46 ` Rob Clark
2013-09-30 18:21 ` Daniel Vetter
2013-09-30 18:36 ` Ville Syrjälä
2013-09-30 18:31 ` Ville Syrjälä [this message]
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=20130930183145.GG9395@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=robdclark@gmail.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.