drm/bridge: lontium-lt8912b: Validate mode in drm_bridge_funcs::mode_valid()
[ Upstream commitfe828fbd87] If the bridge is attached with the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag set, this driver won't initialize a connector and hence display mode won't be validated in drm_connector_helper_funcs::mode_valid(). So, move the mode validation from drm_connector_helper_funcs::mode_valid() to drm_bridge_funcs::mode_valid(), because the mode validation is always done for the bridge. Fixes:30e2ae943c("drm/bridge: Introduce LT8912B DSI to HDMI bridge") Signed-off-by: Liu Ying <victor.liu@nxp.com> Reviewed-by: Robert Foss <rfoss@kernel.org> Signed-off-by: Robert Foss <rfoss@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240813091637.1054586-1-victor.liu@nxp.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e8a4a2e45d
commit
791b3d66d2
@@ -401,22 +401,6 @@ static const struct drm_connector_funcs lt8912_connector_funcs = {
|
||||
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
|
||||
};
|
||||
|
||||
static enum drm_mode_status
|
||||
lt8912_connector_mode_valid(struct drm_connector *connector,
|
||||
struct drm_display_mode *mode)
|
||||
{
|
||||
if (mode->clock > 150000)
|
||||
return MODE_CLOCK_HIGH;
|
||||
|
||||
if (mode->hdisplay > 1920)
|
||||
return MODE_BAD_HVALUE;
|
||||
|
||||
if (mode->vdisplay > 1080)
|
||||
return MODE_BAD_VVALUE;
|
||||
|
||||
return MODE_OK;
|
||||
}
|
||||
|
||||
static int lt8912_connector_get_modes(struct drm_connector *connector)
|
||||
{
|
||||
struct edid *edid;
|
||||
@@ -444,7 +428,6 @@ static int lt8912_connector_get_modes(struct drm_connector *connector)
|
||||
|
||||
static const struct drm_connector_helper_funcs lt8912_connector_helper_funcs = {
|
||||
.get_modes = lt8912_connector_get_modes,
|
||||
.mode_valid = lt8912_connector_mode_valid,
|
||||
};
|
||||
|
||||
static void lt8912_bridge_mode_set(struct drm_bridge *bridge,
|
||||
@@ -590,6 +573,23 @@ static void lt8912_bridge_detach(struct drm_bridge *bridge)
|
||||
drm_bridge_hpd_disable(lt->hdmi_port);
|
||||
}
|
||||
|
||||
static enum drm_mode_status
|
||||
lt8912_bridge_mode_valid(struct drm_bridge *bridge,
|
||||
const struct drm_display_info *info,
|
||||
const struct drm_display_mode *mode)
|
||||
{
|
||||
if (mode->clock > 150000)
|
||||
return MODE_CLOCK_HIGH;
|
||||
|
||||
if (mode->hdisplay > 1920)
|
||||
return MODE_BAD_HVALUE;
|
||||
|
||||
if (mode->vdisplay > 1080)
|
||||
return MODE_BAD_VVALUE;
|
||||
|
||||
return MODE_OK;
|
||||
}
|
||||
|
||||
static enum drm_connector_status
|
||||
lt8912_bridge_detect(struct drm_bridge *bridge)
|
||||
{
|
||||
@@ -620,6 +620,7 @@ static struct edid *lt8912_bridge_get_edid(struct drm_bridge *bridge,
|
||||
static const struct drm_bridge_funcs lt8912_bridge_funcs = {
|
||||
.attach = lt8912_bridge_attach,
|
||||
.detach = lt8912_bridge_detach,
|
||||
.mode_valid = lt8912_bridge_mode_valid,
|
||||
.mode_set = lt8912_bridge_mode_set,
|
||||
.enable = lt8912_bridge_enable,
|
||||
.detect = lt8912_bridge_detect,
|
||||
|
||||
Reference in New Issue
Block a user