[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191114083658.27237-6-james.qian.wang@arm.com>
Date: Thu, 14 Nov 2019 08:37:51 +0000
From: "james qian wang (Arm Technology China)" <james.qian.wang@....com>
To: Liviu Dudau <Liviu.Dudau@....com>,
"airlied@...ux.ie" <airlied@...ux.ie>,
Brian Starkey <Brian.Starkey@....com>,
"maarten.lankhorst@...ux.intel.com"
<maarten.lankhorst@...ux.intel.com>,
"sean@...rly.run" <sean@...rly.run>,
Mihail Atanassov <Mihail.Atanassov@....com>
CC: "Jonathan Chai (Arm Technology China)" <Jonathan.Chai@....com>,
"Julien Yin (Arm Technology China)" <Julien.Yin@....com>,
"Thomas Sun (Arm Technology China)" <thomas.Sun@....com>,
"Lowry Li (Arm Technology China)" <Lowry.Li@....com>,
Ayan Halder <Ayan.Halder@....com>,
"Tiannan Zhu (Arm Technology China)" <Tiannan.Zhu@....com>,
"Yiqi Kang (Arm Technology China)" <Yiqi.Kang@....com>,
nd <nd@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
Ben Davis <Ben.Davis@....com>,
"Oscar Zhang (Arm Technology China)" <Oscar.Zhang@....com>,
"Channing Chen (Arm Technology China)" <Channing.Chen@....com>,
"james qian wang (Arm Technology China)" <james.qian.wang@....com>
Subject: [PATCH v3 5/6] drm/komeda: Update writeback signal for side_by_side
In side by side mode, a writeback job is completed by two pipelines: left
by master and right by slave, we need to wait both pipeline finished (EOW),
then can signal the writeback job completion.
Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@....com>
---
.../gpu/drm/arm/display/komeda/komeda_crtc.c | 23 ++++++++++---------
.../gpu/drm/arm/display/komeda/komeda_kms.h | 5 ++++
.../arm/display/komeda/komeda_wb_connector.c | 3 +++
3 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
index 24928b922fbd..78351b7135f8 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
@@ -193,27 +193,28 @@ komeda_crtc_unprepare(struct komeda_crtc *kcrtc)
return err;
}
-void komeda_crtc_handle_event(struct komeda_crtc *kcrtc,
+void komeda_crtc_handle_event(struct komeda_crtc *kcrtc,
struct komeda_events *evts)
{
struct drm_crtc *crtc = &kcrtc->base;
+ struct komeda_wb_connector *wb_conn = kcrtc->wb_conn;
u32 events = evts->pipes[kcrtc->master->id];
if (events & KOMEDA_EVENT_VSYNC)
drm_crtc_handle_vblank(crtc);
- if (events & KOMEDA_EVENT_EOW) {
- struct komeda_wb_connector *wb_conn = kcrtc->wb_conn;
+ /* handles writeback event */
+ if (events & KOMEDA_EVENT_EOW)
+ wb_conn->complete_pipes |= BIT(kcrtc->master->id);
- if (wb_conn)
- drm_writeback_signal_completion(&wb_conn->base, 0);
- else
- DRM_WARN("CRTC[%d]: EOW happen but no wb_connector.\n",
- drm_crtc_index(&kcrtc->base));
+ if (kcrtc->side_by_side &&
+ (evts->pipes[kcrtc->slave->id] & KOMEDA_EVENT_EOW))
+ wb_conn->complete_pipes |= BIT(kcrtc->slave->id);
+
+ if (wb_conn->expected_pipes == wb_conn->complete_pipes) {
+ wb_conn->complete_pipes = 0;
+ drm_writeback_signal_completion(&wb_conn->base, 0);
}
- /* will handle it together with the write back support */
- if (events & KOMEDA_EVENT_EOW)
- DRM_DEBUG("EOW.\n");
if (events & KOMEDA_EVENT_FLIP) {
unsigned long flags;
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h
index ae6654fe95e2..174fb0a0b49b 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.h
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.h
@@ -58,6 +58,11 @@ struct komeda_wb_connector {
/** @wb_layer: represents associated writeback pipeline of komeda */
struct komeda_layer *wb_layer;
+
+ /** @expected_pipes: pipelines are used for the writeback job */
+ u32 expected_pipes;
+ /** @complete_pipes: pipelines which have finished writeback */
+ u32 complete_pipes;
};
/**
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
index 44e628747654..d6833ea3b822 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c
@@ -157,6 +157,9 @@ static int komeda_wb_connector_add(struct komeda_kms_dev *kms,
return -ENOMEM;
kwb_conn->wb_layer = kcrtc->master->wb_layer;
+ kwb_conn->expected_pipes = BIT(kcrtc->master->id);
+ if (kcrtc->side_by_side)
+ kwb_conn->expected_pipes |= BIT(kcrtc->slave->id);
wb_conn = &kwb_conn->base;
wb_conn->encoder.possible_crtcs = BIT(drm_crtc_index(&kcrtc->base));
--
2.20.1
Powered by blists - more mailing lists