[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXjPjNWl3oVOVYxV@black.igk.intel.com>
Date: Tue, 27 Jan 2026 15:45:32 +0100
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Cristian Ciocaltea <cristian.ciocaltea@...labora.com>
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Sandy Huang <hjc@...k-chips.com>,
Heiko Stübner <heiko@...ech.de>,
Andy Yan <andy.yan@...k-chips.com>,
Louis Chauvet <louis.chauvet@...tlin.com>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Melissa Wen <melissa.srw@...il.com>,
Robert Mader <robert.mader@...labora.com>, kernel@...labora.com,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org,
Diederik de Haas <diederik@...ow-tech.com>
Subject: Re: [PATCH v5 4/4] drm/rockchip: vop2: Support setting custom
background color
On Tue, Jan 27, 2026 at 10:45:36AM +0200, Cristian Ciocaltea wrote:
> The Rockchip VOP2 display controller allows configuring the background
> color of each video output port.
>
> Since a previous patch introduced the BACKGROUND_COLOR CRTC property,
> which defaults to solid black, make use of it when programming the
> hardware.
>
> Note the maximum precision allowed by the display controller is 10bpc,
> while the alpha component is not supported, hence ignored.
...
> + /*
> + * Background color is programmed with 10 bits of precision.
> + * Since performance is more important than accuracy here,
> + * do *not* make use of the DRM_ARGB64_GET*_BPC() helpers.
> + */
> + val = FIELD_PREP(RK3568_VP_DSP_BG__DSP_BG_RED, DRM_ARGB64_GETR(bgcolor) >> 6);
> + val |= FIELD_PREP(RK3568_VP_DSP_BG__DSP_BG_GREEN, DRM_ARGB64_GETG(bgcolor) >> 6);
> + val |= FIELD_PREP(RK3568_VP_DSP_BG__DSP_BG_BLUE, DRM_ARGB64_GETB(bgcolor) >> 6);
There is FIELD_MODIFY() for a few cycles already.
But here it probably makes no much difference.
...
> + seq_printf(s, "\tbackground color (10bpc): r=0x%x g=0x%x b=0x%x\n",
> + DRM_ARGB64_GETR(cstate->background_color) >> 6,
> + DRM_ARGB64_GETG(cstate->background_color) >> 6,
> + DRM_ARGB64_GETB(cstate->background_color) >> 6);
Probably you want to have the alternative to the DRM_ARGB64_GETx() macros which
incorporates a right-shift. But it all in regard to DRM style and preferences.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists