summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiu Ying <victor.liu@nxp.com>2018-08-20 17:32:44 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:58:20 +0800
commit069fb8f38485b86062e601b21530c4bdfb22911f (patch)
treeab66b50f5de9f410551b0992c799ff3067f6a302
parent698aeb479bfe79d79475e907e25b295b9c8514dd (diff)
gpu: imx: dpu: tcon: Add tcon_is_master/slave() helpers support
This patch adds tcon_is_master/slave() helpers support so that callers may know if a tcon is a master or slave tcon. Signed-off-by: Liu Ying <victor.liu@nxp.com>
-rw-r--r--drivers/gpu/imx/dpu/dpu-tcon.c14
-rw-r--r--include/video/dpu.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/imx/dpu/dpu-tcon.c b/drivers/gpu/imx/dpu/dpu-tcon.c
index efed5b74e2c0..199e6e55df15 100644
--- a/drivers/gpu/imx/dpu/dpu-tcon.c
+++ b/drivers/gpu/imx/dpu/dpu-tcon.c
@@ -186,6 +186,20 @@ void tcon_cfg_videomode(struct dpu_tcon *tcon, struct drm_display_mode *m)
}
EXPORT_SYMBOL_GPL(tcon_cfg_videomode);
+bool tcon_is_master(struct dpu_tcon *tcon)
+{
+ const struct dpu_data *data = tcon->dpu->data;
+
+ return tcon->id == data->master_stream_id;
+}
+EXPORT_SYMBOL_GPL(tcon_is_master);
+
+bool tcon_is_slave(struct dpu_tcon *tcon)
+{
+ return !tcon_is_master(tcon);
+}
+EXPORT_SYMBOL_GPL(tcon_is_slave);
+
struct dpu_tcon *dpu_tcon_get(struct dpu_soc *dpu, int id)
{
struct dpu_tcon *tcon;
diff --git a/include/video/dpu.h b/include/video/dpu.h
index 656ec850d715..b565061d1e3a 100644
--- a/include/video/dpu.h
+++ b/include/video/dpu.h
@@ -554,6 +554,8 @@ struct dpu_tcon;
int tcon_set_fmt(struct dpu_tcon *tcon, u32 bus_format);
void tcon_set_operation_mode(struct dpu_tcon *tcon);
void tcon_cfg_videomode(struct dpu_tcon *tcon, struct drm_display_mode *m);
+bool tcon_is_master(struct dpu_tcon *tcon);
+bool tcon_is_slave(struct dpu_tcon *tcon);
struct dpu_tcon *dpu_tcon_get(struct dpu_soc *dpu, int id);
void dpu_tcon_put(struct dpu_tcon *tcon);
struct dpu_tcon *dpu_aux_tcon_peek(struct dpu_tcon *tcon);