From: Jeykumar Sankaran <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
Jeykumar Sankaran
<jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: [PATCH v6 02/19] drm/msm/dpu: squash power handle event types
Date: Fri, 7 Sep 2018 17:24:10 -0700 [thread overview]
Message-ID: <1536366267-22336-3-git-send-email-jsanka@codeaurora.org> (raw)
In-Reply-To: <1536366267-22336-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
DPU power handler maintained PRE/POST versions of power
ENABLE/DISABLE events to accommodate tasks which need be
handled before/after data bus voting. But since the bus voting
API's are deprecated and removed from the driver, squash
the events and their clients respective event handlers
to handle only ENABLE/DISABLE events.
changes in v5:
- introduced in the series
changes in v6:
- define macro values using BIT(x) (Sean)
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
---
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 28 +++++-------------------
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 8 +++----
drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c | 15 +++----------
drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h | 14 ++++--------
4 files changed, 16 insertions(+), 49 deletions(-)
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index 1e0382f..6cc5ba7 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -1281,26 +1281,12 @@ static void dpu_crtc_handle_power_event(u32 event_type, void *arg)
trace_dpu_crtc_handle_power_event(DRMID(crtc), event_type);
- switch (event_type) {
- case DPU_POWER_EVENT_POST_ENABLE:
- /* restore encoder; crtc will be programmed during commit */
- drm_for_each_encoder(encoder, crtc->dev) {
- if (encoder->crtc != crtc)
- continue;
+ /* restore encoder; crtc will be programmed during commit */
+ drm_for_each_encoder(encoder, crtc->dev) {
+ if (encoder->crtc != crtc)
+ continue;
- dpu_encoder_virt_restore(encoder);
- }
- break;
- case DPU_POWER_EVENT_PRE_DISABLE:
- case DPU_POWER_EVENT_POST_DISABLE:
- /**
- * Nothing to do. All the planes on the CRTC will be
- * programmed for every frame
- */
- break;
- default:
- DPU_DEBUG("event:%d not handled\n", event_type);
- break;
+ dpu_encoder_virt_restore(encoder);
}
mutex_unlock(&dpu_crtc->crtc_lock);
@@ -1429,9 +1415,7 @@ static void dpu_crtc_enable(struct drm_crtc *crtc,
drm_crtc_vblank_on(crtc);
dpu_crtc->power_event = dpu_power_handle_register_event(
- dpu_crtc->phandle,
- DPU_POWER_EVENT_POST_ENABLE | DPU_POWER_EVENT_POST_DISABLE |
- DPU_POWER_EVENT_PRE_DISABLE,
+ dpu_crtc->phandle, DPU_POWER_EVENT_ENABLE,
dpu_crtc_handle_power_event, crtc, dpu_crtc->name);
}
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index 5fd2f7f..0a683e6 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -967,8 +967,7 @@ static void dpu_kms_handle_power_event(u32 event_type, void *usr)
if (!dpu_kms)
return;
- if (event_type == DPU_POWER_EVENT_POST_ENABLE)
- dpu_vbif_init_memtypes(dpu_kms);
+ dpu_vbif_init_memtypes(dpu_kms);
}
static int dpu_kms_hw_init(struct msm_kms *kms)
@@ -1155,10 +1154,9 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
/*
* Handle (re)initializations during power enable
*/
- dpu_kms_handle_power_event(DPU_POWER_EVENT_POST_ENABLE, dpu_kms);
+ dpu_kms_handle_power_event(DPU_POWER_EVENT_ENABLE, dpu_kms);
dpu_kms->power_event = dpu_power_handle_register_event(
- &dpu_kms->phandle,
- DPU_POWER_EVENT_POST_ENABLE,
+ &dpu_kms->phandle, DPU_POWER_EVENT_ENABLE,
dpu_kms_handle_power_event, dpu_kms, "kms");
pm_runtime_put_sync(&dpu_kms->pdev->dev);
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
index a75eebc..fc14116 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.c
@@ -145,6 +145,7 @@ int dpu_power_resource_enable(struct dpu_power_handle *phandle,
bool changed = false;
u32 max_usecase_ndx = VOTE_INDEX_DISABLE, prev_usecase_ndx;
struct dpu_power_client *client;
+ u32 event_type;
if (!phandle || !pclient) {
pr_err("invalid input argument\n");
@@ -181,19 +182,9 @@ int dpu_power_resource_enable(struct dpu_power_handle *phandle,
if (!changed)
goto end;
- if (enable) {
- dpu_power_event_trigger_locked(phandle,
- DPU_POWER_EVENT_PRE_ENABLE);
- dpu_power_event_trigger_locked(phandle,
- DPU_POWER_EVENT_POST_ENABLE);
-
- } else {
- dpu_power_event_trigger_locked(phandle,
- DPU_POWER_EVENT_PRE_DISABLE);
- dpu_power_event_trigger_locked(phandle,
- DPU_POWER_EVENT_POST_DISABLE);
- }
+ event_type = enable ? DPU_POWER_EVENT_ENABLE : DPU_POWER_EVENT_DISABLE;
+ dpu_power_event_trigger_locked(phandle, event_type);
end:
mutex_unlock(&phandle->phandle_lock);
return 0;
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
index 344f744..8f648d4 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_power_handle.h
@@ -23,17 +23,11 @@
#include "dpu_io_util.h"
-/* event will be triggered before power handler disable */
-#define DPU_POWER_EVENT_PRE_DISABLE 0x1
+/* event will be triggered on power handler disable */
+#define DPU_POWER_EVENT_DISABLE BIT(1)
-/* event will be triggered after power handler disable */
-#define DPU_POWER_EVENT_POST_DISABLE 0x2
-
-/* event will be triggered before power handler enable */
-#define DPU_POWER_EVENT_PRE_ENABLE 0x4
-
-/* event will be triggered after power handler enable */
-#define DPU_POWER_EVENT_POST_ENABLE 0x8
+/* event will be triggered on power handler enable */
+#define DPU_POWER_EVENT_ENABLE BIT(2)
/**
* mdss_bus_vote_type: register bus vote type
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next prev parent reply other threads:[~2018-09-08 0:24 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-08 0:24 [PATCH v6 00/19] clean up DPU for RM refactor Jeykumar Sankaran
[not found] ` <1536366267-22336-1-git-send-email-jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-09-08 0:24 ` [PATCH v6 01/19] drm/msm/dpu: remove debugfs support for misr Jeykumar Sankaran
2018-09-08 0:24 ` Jeykumar Sankaran [this message]
2018-09-08 0:24 ` [PATCH v6 03/19] drm/msm/dpu: remove scalar config definitions Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 04/19] drm/msm/dpu: remove resource pool manager Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 05/19] drm/msm/dpu: remove ping pong split topology variables Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 06/19] drm/msm/dpu: enable master-slave encoders explicitly Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 07/19] drm/msm/dpu: use kms stored hw mdp block Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 08/19] drm/msm/dpu: iterate for assigned hw ctl in virtual encoder Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 09/19] drm/msm/dpu: avoid querying for hw intf before assignment Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 10/19] drm/msm/dpu: make crtc get_mixer_width helper static Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 11/19] drm/msm/dpu: move hw resource tracking to crtc state Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 12/19] drm/msm/dpu: rename hw_ctl to lm_ctl Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 13/19] drm/msm/dpu: clean up destination scaler residue Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 14/19] drm/msm/dpu: remove cdm block support from resource manager Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 15/19] drm/msm/dpu: remove LOCK/CLEAR support in RM Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 16/19] drm/msm/dpu: remove display H_TILE from encoder Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 17/19] drm/msm/dpu: remove RM dependency on connector state Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 18/19] drm/msm/dpu: relax parameter validation in encoders Jeykumar Sankaran
2018-09-08 0:24 ` [PATCH v6 19/19] drm/msm/dpu: remove RM topology definition Jeykumar Sankaran
2018-09-11 18:20 ` [PATCH v6 00/19] clean up DPU for RM refactor Sean Paul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1536366267-22336-3-git-send-email-jsanka@codeaurora.org \
--to=jsanka-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=hoegsberg-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=jcrouse-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).