Skip to content

Commit f6fafa4

Browse files
committed
fixup! drm/apple: Support color transformation matrices
Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 89c915d commit f6fafa4

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

drivers/gpu/drm/apple/iomfb.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,8 @@ struct iomfb_abort_swaps_dcp_resp {
368368
} __packed;
369369

370370
struct iomfb_set_matrix_req {
371-
u32 unk_u32; // maybe length?
372-
u64 r[3];
373-
u64 g[3];
374-
u64 b[3];
371+
u32 location;
372+
u64 matrix[9];
375373
u8 matrix_null;
376374
u8 padding[3];
377375
} __packed;

drivers/gpu/drm/apple/iomfb_template.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,20 +1407,11 @@ void DCP_FW_NAME(iomfb_flush)(struct apple_dcp *dcp, struct drm_crtc *crtc, stru
14071407
}
14081408

14091409
if (crtc_state->color_mgmt_changed && crtc_state->ctm) {
1410-
struct iomfb_set_matrix_req mat;
14111410
struct drm_color_ctm *ctm = (struct drm_color_ctm *)crtc_state->ctm->data;
1412-
1413-
mat.unk_u32 = 9;
1414-
mat.r[0] = ctm->matrix[0];
1415-
mat.r[1] = ctm->matrix[1];
1416-
mat.r[2] = ctm->matrix[2];
1417-
mat.g[0] = ctm->matrix[3];
1418-
mat.g[1] = ctm->matrix[4];
1419-
mat.g[2] = ctm->matrix[5];
1420-
mat.b[0] = ctm->matrix[6];
1421-
mat.b[1] = ctm->matrix[7];
1422-
mat.b[2] = ctm->matrix[8];
1423-
1411+
struct iomfb_set_matrix_req mat = {
1412+
.location = 9,
1413+
};
1414+
memcpy(mat.matrix, ctm->matrix, sizeof(mat.matrix));
14241415
iomfb_set_matrix(dcp, false, &mat, do_swap, NULL);
14251416
} else
14261417
do_swap(dcp, NULL, NULL);

0 commit comments

Comments
 (0)