mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-22 18:44:44 +08:00
drm/rockchip: analogix_dp: correct the connector display color format and bpc
Rockchip VOP couldn't output YUV video format for eDP controller, so when driver detect connector support YUV video format, we need to hack it down to RGB888. Signed-off-by: Yakir Yang <ykk@rock-chips.com> Acked-by: Mark Yao <mark.yao@rock-chips.com> Reviewed-by: Tomasz Figa <tomasz.figa@chromium.com> Reviewed-by: Sean Paul <seanpaul@chromium.org>
This commit is contained in:
parent
fcc150c515
commit
db8a9aed10
@ -110,6 +110,23 @@ static int rockchip_dp_powerdown(struct analogix_dp_plat_data *plat_data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rockchip_dp_get_modes(struct analogix_dp_plat_data *plat_data,
|
||||
struct drm_connector *connector)
|
||||
{
|
||||
struct drm_display_info *di = &connector->display_info;
|
||||
/* VOP couldn't output YUV video format for eDP rightly */
|
||||
u32 mask = DRM_COLOR_FORMAT_YCRCB444 | DRM_COLOR_FORMAT_YCRCB422;
|
||||
|
||||
if ((di->color_formats & mask)) {
|
||||
DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
|
||||
di->color_formats &= ~mask;
|
||||
di->color_formats |= DRM_COLOR_FORMAT_RGB444;
|
||||
di->bpc = 8;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
rockchip_dp_drm_encoder_mode_fixup(struct drm_encoder *encoder,
|
||||
const struct drm_display_mode *mode,
|
||||
@ -310,6 +327,7 @@ static int rockchip_dp_bind(struct device *dev, struct device *master,
|
||||
dp->plat_data.dev_type = dp->data->chip_type;
|
||||
dp->plat_data.power_on = rockchip_dp_poweron;
|
||||
dp->plat_data.power_off = rockchip_dp_powerdown;
|
||||
dp->plat_data.get_modes = rockchip_dp_get_modes;
|
||||
|
||||
return analogix_dp_bind(dev, dp->drm_dev, &dp->plat_data);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user