On Mon, Oct 08, 2018 at 09:27:33PM -0700, Jeykumar Sankaran wrote: > Encoder uses test_only flag to differentiate RM reservations > invoked from atomic check and atomic_commit phases. > After reserving the HW blocks, if test_only was set, RM > releases the reservation. Retains them if not. Since we > got rid of RM reserve call from atomic_commit path, get rid > of this flag. I think I'm being dense, but I still don't see how the test_only path doesn't result in lasting reservations. Sean > > Signed-off-by: Jeykumar Sankaran <jsanka@xxxxxxxxxxxxxx> > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +- > drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 13 +++---------- > drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h | 4 +--- > 3 files changed, 5 insertions(+), 14 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > index 468b8fd0..dd17528 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c > @@ -636,7 +636,7 @@ static int dpu_encoder_virt_atomic_check( > > if (!ret && drm_atomic_crtc_needs_modeset(crtc_state)) > ret = dpu_rm_reserve(&dpu_kms->rm, drm_enc, crtc_state, > - topology, false); > + topology); > > if (!ret) > drm_mode_set_crtcinfo(adj_mode, 0); > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c > index 3a92a3e..1234991 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c > @@ -631,8 +631,7 @@ int dpu_rm_reserve( > struct dpu_rm *rm, > struct drm_encoder *enc, > struct drm_crtc_state *crtc_state, > - struct msm_display_topology topology, > - bool test_only) > + struct msm_display_topology topology) > { > struct dpu_rm_requirements reqs; > struct dpu_crtc_state *dpu_cstate = to_dpu_crtc_state(crtc_state); > @@ -642,8 +641,8 @@ int dpu_rm_reserve( > if (!drm_atomic_crtc_needs_modeset(crtc_state)) > return 0; > > - DRM_DEBUG_KMS("reserving hw for enc %d crtc %d test_only %d\n", > - enc->base.id, crtc_state->crtc->base.id, test_only); > + DRM_DEBUG_KMS("reserving hw for enc %d crtc %d\n", > + enc->base.id, crtc_state->crtc->base.id); > > mutex_lock(&rm->rm_lock); > > @@ -657,13 +656,7 @@ int dpu_rm_reserve( > if (ret) { > DPU_ERROR("failed to reserve hw resources: %d\n", ret); > _dpu_rm_release_reservation(rm, dpu_cstate); > - } else if (test_only) { > - /* test_only: test the reservation and then undo */ > - DPU_DEBUG("test_only: discard test [enc: %d]\n", > - enc->base.id); > - _dpu_rm_release_reservation(rm, dpu_cstate); > } > - > end: > mutex_unlock(&rm->rm_lock); > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h > index 7ac1553..415eeec 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h > @@ -63,14 +63,12 @@ int dpu_rm_init(struct dpu_rm *rm, > * @drm_enc: DRM Encoder handle > * @crtc_state: Proposed Atomic DRM CRTC State handle > * @topology: Pointer to topology info for the display > - * @test_only: Atomic-Test phase, discard results (unless property overrides) > * @Return: 0 on Success otherwise -ERROR > */ > int dpu_rm_reserve(struct dpu_rm *rm, > struct drm_encoder *drm_enc, > struct drm_crtc_state *crtc_state, > - struct msm_display_topology topology, > - bool test_only); > + struct msm_display_topology topology); > > /** > * dpu_rm_release - Given the encoder for the display chain, release any > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project > -- Sean Paul, Software Engineer, Google / Chromium OS