Skip to content

Commit

Permalink
drm/vc4: Calculate bpc based on max_requested_bpc
Browse files Browse the repository at this point in the history
This aligns vc4 with Intel, AMD and Synopsis drivers and fixes max bpc
connector property not working as expected on monitors with YCbCr 4:2:2
support but not deep color support.

max_bpc in connector state is clamped at max_bpc from display info and
the latter only takes deep color modes into account so it will always
be 8, even if the display can do 4:2:2 12-bit output.

Signed-off-by: Matthias Reichl <hias@horus.com>
  • Loading branch information
HiassofT authored and pelwell committed Feb 8, 2023
1 parent c113cf1 commit 14b3509
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vc4/vc4_hdmi.c
Expand Up @@ -2124,7 +2124,7 @@ vc4_hdmi_encoder_compute_config(const struct vc4_hdmi *vc4_hdmi,
{
struct drm_device *dev = vc4_hdmi->connector.dev;
struct drm_connector_state *conn_state = &vc4_state->base;
unsigned int max_bpc = clamp_t(unsigned int, conn_state->max_bpc, 8, 12);

This comment has been minimized.

Copy link
@imamit01

imamit01 Mar 6, 2023

in this code you need to improve code in line 2 .

This comment has been minimized.

Copy link
@pelwell

pelwell Mar 6, 2023

Contributor

Please be more specific - show what you think the line should be.

unsigned int max_bpc = clamp_t(unsigned int, conn_state->max_requested_bpc, 8, 12);
unsigned int bpc;
int ret;

Expand Down

0 comments on commit 14b3509

Please sign in to comment.