mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jyri Sarha <jsarha@ti.com>
To: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: <jani.nikula@linux.intel.com>, Sean Paul <seanpaul@chromium.org>,
	<ville.syrjala@linux.intel.com>,
	Lionel G Landwerlin <lionel.g.landwerlin@intel.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	"Valkeinen, Tomi" <tomi.valkeinen@ti.com>
Subject: CTM and other color related properties
Date: Wed, 29 Mar 2017 10:23:54 +0300	[thread overview]
Message-ID: <ca492b5a-2dc6-79ca-e022-b2e69e440405@ti.com> (raw)

Referring to this discussion:
https://patchwork.kernel.org/patch/9546905/

Since the discussion, has there been any planning/work been done about
the CTM2 API?

We would need for omap drm (for DSS5 and DSS6) a similar matrix API
for two purposes. However, neither of them is an exact match to the
CTM property.

1. CRTC specific Color Phase Rotation matrix is pretty close to CTM
concept, but it is applied after the gamma correction. However, there
is an optional static full-range or limited-range post-offset vector
and with it the CTM can also be used to convert the RGB output to a
YCbCr display output.

2. Plane specific Color Space Conversion matrix and pre-offset vector
is for YUV to RGB conversion. For customization purposes we would like
to expose this 3x3 matrix and the 3-element offset vector to user
space. So in general this is almost the same thing at the previous, but
for reverse conversion.

So when adding a CTM2 property blob, I would also vote for adding
pre- and post-offset vectors. Then a CSC would simply be a
combination off CTM and either a pre- or post- offset vector or maybe
both, depending on whether the block provides a conversion from RGB to
YUV, the other way around, or both.

Then it is a question whether the offset vectors should be absolute or
or relative to the bit depth of RGB components. A relative, with enough
precision, would be the most generic choice but it would leave a lot of
work to the driver code in many cases.

For convenience there could also be a standard enum for selecting
either custom coefficients or predefined standard conversion
(Full-range, ITU-R BT.601, and ITU-R BT.709 at least).

In general the color space conversion arithmetic are described well
on this web page:
http://www.equasys.de/colorconversion.html

Best regards,
Jyri

             reply	other threads:[~2017-03-29  7:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29  7:23 Jyri Sarha [this message]
2017-03-29  9:14 ` Ville Syrjälä

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=ca492b5a-2dc6-79ca-e022-b2e69e440405@ti.com \
    --to=jsarha@ti.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lionel.g.landwerlin@intel.com \
    --cc=seanpaul@chromium.org \
    --cc=tomi.valkeinen@ti.com \
    --cc=ville.syrjala@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®