drm/msm: minimize qos remap updates

Updating qos remap updates requires reading registers to update values,
this adds additional CPU processing when in reality this update is only
needed once.

Bug: 142504774
Change-Id: Iec8d4dfd858b0602db7d2275b6b716dbcffe0d2f
Signed-off-by: Adrian Salido <salidoa@google.com>
Signed-off-by: PrimoDev23 <lexx.ps2711@gmail.com>
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
(cherry picked from commit c2a83892e03d0337161df3c0e4aef80248854bea)
This commit is contained in:
Adrian Salido 2019-10-18 15:23:17 -07:00 committed by Richard Raya
parent 03bd541d07
commit d8c6eebcd2
2 changed files with 16 additions and 5 deletions

View File

@ -3889,6 +3889,7 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
struct sde_rect src, dst; struct sde_rect src, dst;
bool is_rt;
bool q16_data = true; bool q16_data = true;
int idx; int idx;
@ -4032,12 +4033,17 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
_sde_plane_set_scanout(plane, pstate, &psde->pipe_cfg, fb); _sde_plane_set_scanout(plane, pstate, &psde->pipe_cfg, fb);
is_rt = sde_crtc_get_client_type(crtc) != NRT_CLIENT;
if (is_rt != psde->is_rt_pipe) {
psde->is_rt_pipe = is_rt;
pstate->dirty |= SDE_PLANE_DIRTY_QOS;
}
/* early out if nothing dirty */ /* early out if nothing dirty */
if (!pstate->dirty) if (!pstate->dirty)
return 0; return 0;
pstate->pending = true; pstate->pending = true;
psde->is_rt_pipe = (sde_crtc_get_client_type(crtc) != NRT_CLIENT);
_sde_plane_set_qos_ctrl(plane, false, SDE_PLANE_QOS_PANIC_CTRL); _sde_plane_set_qos_ctrl(plane, false, SDE_PLANE_QOS_PANIC_CTRL);
/* update secure session flag */ /* update secure session flag */
@ -4246,8 +4252,11 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
&psde->sharp_cfg); &psde->sharp_cfg);
} }
_sde_plane_set_qos_lut(plane, fb); if (pstate->dirty & (SDE_PLANE_DIRTY_QOS | SDE_PLANE_DIRTY_RECTS |
_sde_plane_set_danger_lut(plane, fb); SDE_PLANE_DIRTY_FORMAT)) {
_sde_plane_set_qos_lut(plane, fb);
_sde_plane_set_danger_lut(plane, fb);
}
if (plane->type != DRM_PLANE_TYPE_CURSOR) { if (plane->type != DRM_PLANE_TYPE_CURSOR) {
_sde_plane_set_qos_ctrl(plane, true, SDE_PLANE_QOS_PANIC_CTRL); _sde_plane_set_qos_ctrl(plane, true, SDE_PLANE_QOS_PANIC_CTRL);
@ -4256,7 +4265,8 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
_sde_plane_set_ts_prefill(plane, pstate); _sde_plane_set_ts_prefill(plane, pstate);
} }
_sde_plane_set_qos_remap(plane); if (pstate->dirty & SDE_PLANE_DIRTY_QOS)
_sde_plane_set_qos_remap(plane);
/* clear dirty */ /* clear dirty */
pstate->dirty = 0x0; pstate->dirty = 0x0;

View File

@ -96,7 +96,8 @@ struct sde_plane_rot_state {
#define SDE_PLANE_DIRTY_VIG_GAMUT 0x20 #define SDE_PLANE_DIRTY_VIG_GAMUT 0x20
#define SDE_PLANE_DIRTY_VIG_IGC 0x40 #define SDE_PLANE_DIRTY_VIG_IGC 0x40
#define SDE_PLANE_DIRTY_DMA_IGC 0x80 #define SDE_PLANE_DIRTY_DMA_IGC 0x80
#define SDE_PLANE_DIRTY_DMA_GC 0x100 #define SDE_PLANE_DIRTY_DMA_GC 0x100
#define SDE_PLANE_DIRTY_QOS 0x200
#define SDE_PLANE_DIRTY_CP (SDE_PLANE_DIRTY_VIG_GAMUT |\ #define SDE_PLANE_DIRTY_CP (SDE_PLANE_DIRTY_VIG_GAMUT |\
SDE_PLANE_DIRTY_VIG_IGC | SDE_PLANE_DIRTY_DMA_IGC |\ SDE_PLANE_DIRTY_VIG_IGC | SDE_PLANE_DIRTY_DMA_IGC |\
SDE_PLANE_DIRTY_DMA_GC) SDE_PLANE_DIRTY_DMA_GC)