From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: "Vetter, Daniel" <daniel.vetter@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v9] drm/i915/skl: Add support for SKL background color
Date: Tue, 5 May 2015 17:33:03 +0300 [thread overview]
Message-ID: <20150505143303.GG18908@intel.com> (raw)
In-Reply-To: <20150504075717.GH30184@phenom.ffwll.local>
On Mon, May 04, 2015 at 09:57:17AM +0200, Daniel Vetter wrote:
> On Mon, Apr 27, 2015 at 08:33:38PM +0000, Konduru, Chandra wrote:
> > > -----Original Message-----
> > > From: Ville Syrjälä [mailto:ville.syrjala@linux.intel.com]
> > > Sent: Monday, April 27, 2015 8:28 AM
> > > On Fri, Feb 20, 2015 at 04:11:33PM -0800, Chandra Konduru wrote:
> > > > This patch adds support for Skylake display pipe background color.
> > > > + <td valign="top" >Background color in 16bpc BGR (B-MSB, R-LSB)</td>
> > >
> > > I'd prefer to settle on ARGB msb->lsb layout, unless there's already precedent
> > > for something else. I think it's the most common component order around, and
> > > so should result in least amount of code to stuff the bits into the hardware
> > > registers.
> >
> > To give some background on this, initially using ARGB msb->lsb layout to stuff
> > bit into hw regs, but changed to BGR msb->lsb per feedback. Before reversing/
> > respunning, would like to have an agreement. Daniel/Damien, are you ok with
> > reversing the order to align with hw? Or just keep the way current patch doing?
>
> Imo if we want to really end up with a real standard we should have a
> macro to encode ARGB values and 4 macros to extract the individual parts
> in some uapi header and use that instead of open-coding shifts. That would
> need to be a drm core header ofc.
Sounds like a decent idea.
> The exact layout is probably irrelevant
> anyway.
I think going with (A)RGB makes it much easier to parse when you're
looking at the hex string. That's the order those things usually come
in.
Which brings another point to mind. Should we define a new property type
for color data? Would make it easier to pretty-print in userland.
Using decimal for color data isn't very useful after all.
> -Daniel
>
> >
> > >
> > > > +static int intel_crtc_set_property(struct drm_crtc *crtc,
> > > > + struct drm_property *property, uint64_t val) {
> > > > + struct drm_device *dev = crtc->dev;
> > > > + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> > > > + int i;
> > > > +
> > > > + if (INTEL_INFO(dev)->gen >= 9) {
> > > > + if (property == dev->mode_config.background_color_property)
> > > {
> > > > + uint64_t bottom = 0;
> > > > +
> > > > + /* BGR 16bpc ==> RGB 10bpc */
> > > > + for (i = 0; i < 3; i++)
> > > > + bottom |= (((val >> (i * 16 + 6)) & 0x3FF) << ((2 -
> > > i) * 10));
> > > > +
> > > > + intel_crtc->background_color = (uint32_t) bottom;
> > > > +
> > > > + skl_crtc_set_background_color(intel_crtc);
> > > > + }
> > > > + return 0;
> > > > + }
> > > > + return -EINVAL;
> > > > +}
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-05-05 14:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-21 0:11 [PATCH v9] drm/i915/skl: Add support for SKL background color Chandra Konduru
2015-02-24 0:10 ` Daniel Vetter
2015-04-27 15:28 ` Ville Syrjälä
2015-04-27 20:33 ` Konduru, Chandra
2015-05-04 7:57 ` Daniel Vetter
2015-05-05 14:33 ` Ville Syrjälä [this message]
2015-05-06 8:57 ` 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=20150505143303.GG18908@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel.vetter@intel.com \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
/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