Skip to content

Commit b1ffa7c

Browse files
committed
drm/apple: Only assume RGB planes on internal displays are sRGB
For external displays with EDID user space might use the colorimetry information therein and use color mapping with the expectation of using that color space. DCP's native color space is the correct choice for that. Fixes: 667ca85 ("drm: apple: Assume all RGB planes are sRGB") Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 90f352b commit b1ffa7c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

drivers/gpu/drm/apple/iomfb_template.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,14 @@ void DCP_FW_NAME(iomfb_flush)(struct apple_dcp *dcp, struct drm_crtc *crtc, stru
13621362
req->surf_iova[l] = apple_state->iova;
13631363
req->surf[l].base = apple_state->surf;
13641364

1365+
/* Use sRGB colorspace only for internal panels. External
1366+
* displays are expected to have EDID and user space can use
1367+
* the contained colorimetry information to provide native
1368+
* colors.
1369+
*/
1370+
if (dcp->connector_type == DRM_MODE_CONNECTOR_eDP &&
1371+
req->surf[l].base.colorspace == DCP_COLORSPACE_BG_SRGB)
1372+
req->surf[l].base.colorspace = DCP_COLORSPACE_NATIVE;
13651373
}
13661374

13671375
if (!has_surface && !crtc_state->color_mgmt_changed) {

drivers/gpu/drm/apple/plane.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static enum dcp_colorspace get_colorspace(bool is_yuv,
191191
enum drm_color_encoding enc)
192192
{
193193
if (!is_yuv)
194-
return DCP_COLORSPACE_BG_SRGB;
194+
return DCP_COLORSPACE_NATIVE;
195195

196196
switch (enc) {
197197
case DRM_COLOR_YCBCR_BT601:

0 commit comments

Comments
 (0)