From: Philippe CORNU <philippe.cornu@st.com>
To: Benjamin Gaignard <benjamin.gaignard@linaro.org>,
Yannick FERTRE <yannick.fertre@st.com>
Cc: Alexandre TORGUE <alexandre.torgue@st.com>,
David Airlie <airlied@linux.ie>,
Fabien DESSENNE <fabien.dessenne@st.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"Mickael REULIER" <mickael.reulier@st.com>,
Vincent ABRIOU <vincent.abriou@st.com>
Subject: Re: [PATCH v1 1/2] drm/stm: ltdc: add non-alpha color formats
Date: Thu, 8 Feb 2018 15:02:24 +0000 [thread overview]
Message-ID: <17063027-1eb8-b7f8-4532-ef5ca92e7ea7@st.com> (raw)
In-Reply-To: <CA+M3ks7Dc47FZB6DSm-hZEuOo7KHZyS+7ueeN7xZ4mCktbD1cw@mail.gmail.com>
Hi Benjamin,
and many thanks for having applied the 2 patches.
Philippe :-)
On 02/08/2018 10:40 AM, Benjamin Gaignard wrote:
> 2018-02-06 10:12 GMT+01:00 Yannick FERTRE <yannick.fertre@st.com>:
>> Reviewed-by: Yannick Fertré <yannick.fertre@st.com>
>>
>>
>> On 02/01/2018 11:42 AM, Philippe Cornu wrote:
>>> ltdc supports natively some color formats with alpha (like
>>> ARGB8888, ARGB1555, ARGB4444...). Related non-alpha formats are
>>> supported too (ARGB8888->XRGB8888, ARGB4444->XRGB4444...) by
>>> adjusting ltdc blending factors.
>>>
>>> Note: Wayland/Weston requests by default the non-alpha XRGB8888
>>> color format.
>>>
>>> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
>
> Applied on drm-misc-next
>
> Benjamin
>>> ---
>>> drivers/gpu/drm/stm/ltdc.c | 33 +++++++++++++++++++++++++++++++--
>>> 1 file changed, 31 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
>>> index 90b3de516c91..f6f26fc0ae9e 100644
>>> --- a/drivers/gpu/drm/stm/ltdc.c
>>> +++ b/drivers/gpu/drm/stm/ltdc.c
>>> @@ -328,6 +328,26 @@ static inline u32 to_drm_pixelformat(enum ltdc_pix_fmt pf)
>>> }
>>> }
>>>
>>> +static inline u32 get_pixelformat_without_alpha(u32 drm)
>>> +{
>>> + switch (drm) {
>>> + case DRM_FORMAT_ARGB4444:
>>> + return DRM_FORMAT_XRGB4444;
>>> + case DRM_FORMAT_RGBA4444:
>>> + return DRM_FORMAT_RGBX4444;
>>> + case DRM_FORMAT_ARGB1555:
>>> + return DRM_FORMAT_XRGB1555;
>>> + case DRM_FORMAT_RGBA5551:
>>> + return DRM_FORMAT_RGBX5551;
>>> + case DRM_FORMAT_ARGB8888:
>>> + return DRM_FORMAT_XRGB8888;
>>> + case DRM_FORMAT_RGBA8888:
>>> + return DRM_FORMAT_RGBX8888;
>>> + default:
>>> + return 0;
>>> + }
>>> +}
>>> +
>>> static irqreturn_t ltdc_irq_thread(int irq, void *arg)
>>> {
>>> struct drm_device *ddev = arg;
>>> @@ -680,6 +700,9 @@ static void ltdc_plane_atomic_update(struct drm_plane *plane,
>>>
>>> /* Specifies the blending factors */
>>> val = BF1_PAXCA | BF2_1PAXCA;
>>> + if (!fb->format->has_alpha)
>>> + val = BF1_CA | BF2_1CA;
>>> +
>>> reg_update_bits(ldev->regs, LTDC_L1BFCR + lofs,
>>> LXBFCR_BF2 | LXBFCR_BF1, val);
>>>
>>> @@ -747,8 +770,8 @@ static struct drm_plane *ltdc_plane_create(struct drm_device *ddev,
>>> struct device *dev = ddev->dev;
>>> struct drm_plane *plane;
>>> unsigned int i, nb_fmt = 0;
>>> - u32 formats[NB_PF];
>>> - u32 drm_fmt;
>>> + u32 formats[NB_PF * 2];
>>> + u32 drm_fmt, drm_fmt_no_alpha;
>>> int ret;
>>>
>>> /* Get supported pixel formats */
>>> @@ -757,6 +780,12 @@ static struct drm_plane *ltdc_plane_create(struct drm_device *ddev,
>>> if (!drm_fmt)
>>> continue;
>>> formats[nb_fmt++] = drm_fmt;
>>> +
>>> + /* Add the no-alpha related format if any & supported */
>>> + drm_fmt_no_alpha = get_pixelformat_without_alpha(drm_fmt);
>>> + if (!drm_fmt_no_alpha)
>>> + continue;
>>> + formats[nb_fmt++] = drm_fmt_no_alpha;
>>> }
>>>
>>> plane = devm_kzalloc(dev, sizeof(*plane), GFP_KERNEL);
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
next prev parent reply other threads:[~2018-02-08 15:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-01 10:42 [PATCH v1 0/2] " Philippe Cornu
2018-02-01 10:42 ` [PATCH v1 1/2] " Philippe Cornu
2018-02-05 19:23 ` kbuild test robot
2018-02-06 9:12 ` Yannick FERTRE
2018-02-08 9:40 ` Benjamin Gaignard
2018-02-08 15:02 ` Philippe CORNU [this message]
2018-02-01 10:42 ` [PATCH v1 2/2] drm/stm: ltdc: remove non-alpha color formats on layer 2 for older hw Philippe Cornu
2018-02-06 9:13 ` Yannick FERTRE
2018-02-08 9:40 ` Benjamin Gaignard
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=17063027-1eb8-b7f8-4532-ef5ca92e7ea7@st.com \
--to=philippe.cornu@st.com \
--cc=airlied@linux.ie \
--cc=alexandre.torgue@st.com \
--cc=benjamin.gaignard@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=fabien.dessenne@st.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mickael.reulier@st.com \
--cc=vincent.abriou@st.com \
--cc=yannick.fertre@st.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®