Skip to content

Commit

Permalink
drm/msm: minimize qos remap updates
Browse files Browse the repository at this point in the history
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
Bug: 142167858
Change-Id: Iec8d4dfd858b0602db7d2275b6b716dbcffe0d2f
Signed-off-by: Adrian Salido <[email protected]>
  • Loading branch information
adriansm authored and Joker-V2 committed Jul 24, 2021
1 parent 6278955 commit debae9e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
18 changes: 14 additions & 4 deletions drivers/gpu/drm/msm/sde/sde_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -3889,6 +3889,7 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
struct drm_crtc *crtc;
struct drm_framebuffer *fb;
struct sde_rect src, dst;
bool is_rt;
bool q16_data = true;
int idx;

Expand Down Expand Up @@ -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);

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 */
if (!pstate->dirty)
return 0;
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);

/* update secure session flag */
Expand Down Expand Up @@ -4246,8 +4252,11 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
&psde->sharp_cfg);
}

_sde_plane_set_qos_lut(plane, fb);
_sde_plane_set_danger_lut(plane, fb);
if (pstate->dirty & (SDE_PLANE_DIRTY_QOS | SDE_PLANE_DIRTY_RECTS |
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) {
_sde_plane_set_qos_ctrl(plane, true, SDE_PLANE_QOS_PANIC_CTRL);
Expand All @@ -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_qos_remap(plane);
if (pstate->dirty & SDE_PLANE_DIRTY_QOS)
_sde_plane_set_qos_remap(plane);

/* clear dirty */
pstate->dirty = 0x0;
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/msm/sde/sde_plane.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ struct sde_plane_rot_state {
#define SDE_PLANE_DIRTY_VIG_GAMUT 0x20
#define SDE_PLANE_DIRTY_VIG_IGC 0x40
#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 |\
SDE_PLANE_DIRTY_VIG_IGC | SDE_PLANE_DIRTY_DMA_IGC |\
SDE_PLANE_DIRTY_DMA_GC)
Expand Down

0 comments on commit debae9e

Please sign in to comment.