summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiu Ying <victor.liu@nxp.com>2017-07-24 13:26:19 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit0f1e0edcc061e685f0839a5b3f55f3eaa5c210f5 (patch)
tree17e2d265bda3dc4457c835db1847d68172290af3
parentacdf6dcdb660f111cb623b1d961ff1a6f645c09e (diff)
MLK-16075-1 gpu: imx: dpu: fetchdecode: Update funcs to enable/disable src buf
The bit to enable/disable source buffer is embedded in the register LAYERPORPERTY0. However, the other bits of the register may have other functionalities. So, using fetchdecode_layerproperty() to enable/disable source buffer isn't appropriate. This patch uses new functions to enable/disable fetchdecode source buffer so that the function names could be a bit specific about what they are doing. Signed-off-by: Liu Ying <victor.liu@nxp.com>
-rw-r--r--drivers/gpu/drm/imx/dpu/dpu-crtc.c2
-rw-r--r--drivers/gpu/drm/imx/dpu/dpu-plane.c2
-rw-r--r--drivers/gpu/imx/dpu/dpu-fetchdecode.c21
-rw-r--r--include/video/dpu.h3
4 files changed, 19 insertions, 9 deletions
diff --git a/drivers/gpu/drm/imx/dpu/dpu-crtc.c b/drivers/gpu/drm/imx/dpu/dpu-crtc.c
index 7277ef1374d6..6ab102b93c05 100644
--- a/drivers/gpu/drm/imx/dpu/dpu-crtc.c
+++ b/drivers/gpu/drm/imx/dpu/dpu-crtc.c
@@ -276,7 +276,7 @@ static void dpu_crtc_atomic_begin(struct drm_crtc *crtc,
vs = fetchdecode_get_vscaler(fd);
layerblend_pixengcfg_clken(lb, CLKEN__DISABLE);
- fetchdecode_layerproperty(fd, false);
+ fetchdecode_source_buffer_disable(fd);
hscaler_pixengcfg_clken(hs, CLKEN__DISABLE);
vscaler_pixengcfg_clken(vs, CLKEN__DISABLE);
hscaler_mode(hs, SCALER_NEUTRAL);
diff --git a/drivers/gpu/drm/imx/dpu/dpu-plane.c b/drivers/gpu/drm/imx/dpu/dpu-plane.c
index 7b2729c43ef5..731b1f4b6fb1 100644
--- a/drivers/gpu/drm/imx/dpu/dpu-plane.c
+++ b/drivers/gpu/drm/imx/dpu/dpu-plane.c
@@ -270,7 +270,7 @@ static void dpu_plane_atomic_update(struct drm_plane *plane,
fetchdecode_source_stride(fd, fb->pitches[0]);
fetchdecode_src_buf_dimensions(fd, src_w, src_h);
fetchdecode_set_fmt(fd, fb->pixel_format);
- fetchdecode_layerproperty(fd, true);
+ fetchdecode_source_buffer_enable(fd);
fetchdecode_framedimensions(fd, src_w, src_h);
fetchdecode_baseaddress(fd, drm_plane_state_to_baseaddr(state));
fetchdecode_set_stream_id(fd, dplane->stream_id ?
diff --git a/drivers/gpu/imx/dpu/dpu-fetchdecode.c b/drivers/gpu/imx/dpu/dpu-fetchdecode.c
index 533427b88dbd..7b0ebe9b87b2 100644
--- a/drivers/gpu/imx/dpu/dpu-fetchdecode.c
+++ b/drivers/gpu/imx/dpu/dpu-fetchdecode.c
@@ -261,20 +261,29 @@ void fetchdecode_clipoffset(struct dpu_fetchdecode *fd, unsigned int x,
}
EXPORT_SYMBOL_GPL(fetchdecode_clipoffset);
-void fetchdecode_layerproperty(struct dpu_fetchdecode *fd, bool enable)
+void fetchdecode_source_buffer_enable(struct dpu_fetchdecode *fd)
{
u32 val;
- if (enable)
- val = SOURCEBUFFERENABLE;
- else
- val = 0;
+ mutex_lock(&fd->mutex);
+ val = dpu_fd_read(fd, LAYERPROPERTY0);
+ val |= SOURCEBUFFERENABLE;
+ dpu_fd_write(fd, val, LAYERPROPERTY0);
+ mutex_unlock(&fd->mutex);
+}
+EXPORT_SYMBOL_GPL(fetchdecode_source_buffer_enable);
+
+void fetchdecode_source_buffer_disable(struct dpu_fetchdecode *fd)
+{
+ u32 val;
mutex_lock(&fd->mutex);
+ val = dpu_fd_read(fd, LAYERPROPERTY0);
+ val &= ~SOURCEBUFFERENABLE;
dpu_fd_write(fd, val, LAYERPROPERTY0);
mutex_unlock(&fd->mutex);
}
-EXPORT_SYMBOL_GPL(fetchdecode_layerproperty);
+EXPORT_SYMBOL_GPL(fetchdecode_source_buffer_disable);
bool fetchdecode_is_enabled(struct dpu_fetchdecode *fd)
{
diff --git a/include/video/dpu.h b/include/video/dpu.h
index 45d7668b9ba4..cc9adcd277d7 100644
--- a/include/video/dpu.h
+++ b/include/video/dpu.h
@@ -481,7 +481,8 @@ void fetchdecode_clipoffset(struct dpu_fetchdecode *fd, unsigned int x,
unsigned int y);
void fetchdecode_clipdimensions(struct dpu_fetchdecode *fd, unsigned int w,
unsigned int h);
-void fetchdecode_layerproperty(struct dpu_fetchdecode *fd, bool enable);
+void fetchdecode_source_buffer_enable(struct dpu_fetchdecode *fd);
+void fetchdecode_source_buffer_disable(struct dpu_fetchdecode *fd);
bool fetchdecode_is_enabled(struct dpu_fetchdecode *fd);
void fetchdecode_framedimensions(struct dpu_fetchdecode *fd, unsigned int w,
unsigned int h);