video/drm: Add bridge get_timing interface
Some bridge can't get tv edid such as rk1000 cvbs, but at present bridge can't provide timing without edid. So we add get_timing interface to provide timing. Change-Id: Id74802a3bff8140e3677f6633788aacd021afc91 Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
This commit is contained in:
parent
a0614e0a98
commit
75eb6fceb5
|
|
@ -55,6 +55,15 @@ int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size)
|
||||||
return ops->read_edid(dev, buf, buf_size);
|
return ops->read_edid(dev, buf, buf_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int video_bridge_get_timing(struct udevice *dev)
|
||||||
|
{
|
||||||
|
struct video_bridge_ops *ops = video_bridge_get_ops(dev);
|
||||||
|
|
||||||
|
if (!ops || !ops->get_timing)
|
||||||
|
return -ENOSYS;
|
||||||
|
return ops->get_timing(dev);
|
||||||
|
}
|
||||||
|
|
||||||
static int video_bridge_pre_probe(struct udevice *dev)
|
static int video_bridge_pre_probe(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev);
|
struct video_bridge_priv *uc_priv = dev_get_uclass_priv(dev);
|
||||||
|
|
|
||||||
|
|
@ -586,6 +586,8 @@ static int display_init(struct display_state *state)
|
||||||
&bpc);
|
&bpc);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
edid_print_info((void *)&conn_state->edid);
|
edid_print_info((void *)&conn_state->edid);
|
||||||
|
} else {
|
||||||
|
ret = video_bridge_get_timing(conn_state->bridge->dev);
|
||||||
}
|
}
|
||||||
} else if (conn_funcs->get_timing) {
|
} else if (conn_funcs->get_timing) {
|
||||||
ret = conn_funcs->get_timing(state);
|
ret = conn_funcs->get_timing(state);
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,14 @@ struct video_bridge_ops {
|
||||||
* @return number of bytes read, <=0 for error
|
* @return number of bytes read, <=0 for error
|
||||||
*/
|
*/
|
||||||
int (*read_edid)(struct udevice *dev, u8 *buf, int buf_size);
|
int (*read_edid)(struct udevice *dev, u8 *buf, int buf_size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get_timing() - Get timing from bridge
|
||||||
|
*
|
||||||
|
* @dev: Device to get timing
|
||||||
|
* @return 0 if OK, -ve on error
|
||||||
|
*/
|
||||||
|
int (*get_timing)(struct udevice *dev);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define video_bridge_get_ops(dev) \
|
#define video_bridge_get_ops(dev) \
|
||||||
|
|
@ -109,4 +117,11 @@ int video_bridge_check_attached(struct udevice *dev);
|
||||||
*/
|
*/
|
||||||
int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size);
|
int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* video_bridge_get_timing() - Get timing from bridge
|
||||||
|
*
|
||||||
|
* @dev: Device to get timing
|
||||||
|
* @return 0 if OK, -ve on error
|
||||||
|
*/
|
||||||
|
int video_bridge_get_timing(struct udevice *dev);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue