mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2026-01-27 12:35:36 +01:00
drm/bridge: lontium-lt8912b: Validate mode in drm_bridge_funcs::mode_valid()
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
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
This commit is contained in:
parent
fd990e4c79
commit
c1943c45a4
|
|
@ -411,22 +411,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)
|
||||
{
|
||||
const struct drm_edid *drm_edid;
|
||||
|
|
@ -452,7 +436,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,
|
||||
|
|
@ -595,6 +578,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)
|
||||
{
|
||||
|
|
@ -625,6 +625,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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user