1
0
Fork 0

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>
pull/10/head
Liu Ying 2017-07-24 13:26:19 +08:00 committed by Jason Liu
parent bce7007b87
commit fd658f3e68
4 changed files with 20 additions and 10 deletions

View File

@ -290,7 +290,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);

View File

@ -268,7 +268,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->format->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 ?

View File

@ -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_layerproperty);
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_source_buffer_disable);
bool fetchdecode_is_enabled(struct dpu_fetchdecode *fd)
{

View File

@ -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);