mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
drm/bridge: analogix_dp: Move the color format check to .atomic_check() for Rockchip platforms
For Rockchip platforms, the YUV color formats are currently unsupported. This compatibility check was previously implemented in &analogix_dp_plat_data.get_modes(). Moving color format check to &drm_connector_helper_funcs.atomic_check() would get rid of &analogix_dp_plat_data.get_modes() and be more reasonable than before. Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Heiko Stuebner <heiko@sntech.de> # rk3588 Link: https://patch.msgid.link/20260409065301.446670-8-damon.ding@rock-chips.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
parent
312a86806b
commit
d3bdde2e0c
|
|
@ -894,8 +894,19 @@ static int analogix_dp_atomic_check(struct drm_connector *connector,
|
|||
struct drm_atomic_state *state)
|
||||
{
|
||||
struct analogix_dp_device *dp = to_dp(connector);
|
||||
struct drm_display_info *di = &connector->display_info;
|
||||
struct drm_connector_state *conn_state;
|
||||
struct drm_crtc_state *crtc_state;
|
||||
u32 mask = BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) | BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
|
||||
|
||||
if (is_rockchip(dp->plat_data->dev_type)) {
|
||||
if ((di->color_formats & mask)) {
|
||||
DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
|
||||
di->color_formats &= ~mask;
|
||||
di->color_formats |= BIT(DRM_OUTPUT_COLOR_FORMAT_RGB444);
|
||||
di->bpc = 8;
|
||||
}
|
||||
}
|
||||
|
||||
conn_state = drm_atomic_get_new_connector_state(state, connector);
|
||||
if (WARN_ON(!conn_state))
|
||||
|
|
|
|||
|
|
@ -166,23 +166,6 @@ 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 = BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR444) | BIT(DRM_OUTPUT_COLOR_FORMAT_YCBCR422);
|
||||
|
||||
if ((di->color_formats & mask)) {
|
||||
DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
|
||||
di->color_formats &= ~mask;
|
||||
di->color_formats |= BIT(DRM_OUTPUT_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,
|
||||
|
|
@ -483,7 +466,6 @@ static int rockchip_dp_probe(struct platform_device *pdev)
|
|||
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;
|
||||
|
||||
ret = rockchip_dp_of_probe(dp);
|
||||
if (ret < 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user