From: John Hunter <zhjwpku@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 8/8] drm/bochs: atomic dpms support
Date: Thu, 16 Jul 2015 20:20:41 +0800 [thread overview]
Message-ID: <1437049241-11972-9-git-send-email-zhjwpku@gmail.com> (raw)
In-Reply-To: <1437049241-11972-1-git-send-email-zhjwpku@gmail.com>
From: Zhao Junwang <zhjwpku@gmail.com>
- use ->disable() and ->enable() for crct and plane
- use drm_atomic_helper_connector_dpms for connector
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Zhao Junwang <zhjwpku@gmail.com>
---
drivers/gpu/drm/bochs/bochs_kms.c | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
index 599f367..eccd0a7 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -23,16 +23,20 @@ MODULE_PARM_DESC(defy, "default y resolution");
/* ---------------------------------------------------------------------- */
-static void bochs_crtc_dpms(struct drm_crtc *crtc, int mode)
+static void bochs_crtc_enable(struct drm_crtc *crtc)
{
- switch (mode) {
- case DRM_MODE_DPMS_ON:
- case DRM_MODE_DPMS_STANDBY:
- case DRM_MODE_DPMS_SUSPEND:
- case DRM_MODE_DPMS_OFF:
- default:
+ if (crtc->enabled)
return;
- }
+
+ crtc->enabled = true;
+}
+
+static void bochs_crtc_disable(struct drm_crtc *crtc)
+{
+ if (!crtc->enabled)
+ return;
+
+ crtc->enabled = false;
}
static bool bochs_crtc_mode_fixup(struct drm_crtc *crtc,
@@ -71,7 +75,8 @@ static const struct drm_crtc_funcs bochs_crtc_funcs = {
};
static const struct drm_crtc_helper_funcs bochs_helper_funcs = {
- .dpms = bochs_crtc_dpms,
+ .enable = bochs_crtc_enable,
+ .disable = bochs_crtc_disable,
.mode_fixup = bochs_crtc_mode_fixup,
.mode_set_nofb = bochs_crtc_mode_set_nofb,
.commit = bochs_crtc_commit,
@@ -204,7 +209,11 @@ static void bochs_encoder_mode_set(struct drm_encoder *encoder,
{
}
-static void bochs_encoder_dpms(struct drm_encoder *encoder, int state)
+static void bochs_encoder_enable(struct drm_encoder *encoder)
+{
+}
+
+static void bochs_encoder_disable(struct drm_encoder *encoder)
{
}
@@ -213,7 +222,8 @@ static void bochs_encoder_commit(struct drm_encoder *encoder)
}
static const struct drm_encoder_helper_funcs bochs_encoder_helper_funcs = {
- .dpms = bochs_encoder_dpms,
+ .enable = bochs_encoder_enable,
+ .disable = bochs_encoder_disable,
.mode_fixup = bochs_encoder_mode_fixup,
.mode_set = bochs_encoder_mode_set,
.commit = bochs_encoder_commit,
@@ -286,7 +296,7 @@ struct drm_connector_helper_funcs bochs_connector_connector_helper_funcs = {
};
struct drm_connector_funcs bochs_connector_connector_funcs = {
- .dpms = drm_helper_connector_dpms,
+ .dpms = drm_atomic_helper_connector_dpms,
.detect = bochs_connector_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = drm_connector_cleanup,
--
1.7.10.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-07-16 12:21 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-16 12:20 [PATCH 0/8] drm/bochs: convert bochs to atomic mode-setting John Hunter
2015-07-16 12:20 ` [PATCH 1/8] drm/bochs: phase 1 - use the transitional helpers John Hunter
2015-07-16 15:49 ` Gerd Hoffmann
2015-07-16 18:22 ` Daniel Vetter
2015-07-16 12:20 ` [PATCH 2/8] drm/bochs: phase 2: wire up state reset(), duplicate() and destroy John Hunter
2015-07-16 12:20 ` [PATCH 3/8] drm/bochs: stop looking at legacy state John Hunter
2015-07-16 12:20 ` [PATCH 4/8] drm/bochs: phase 3: for plane updates: switch to atomic helper internally John Hunter
2015-07-16 12:20 ` [PATCH 5/8] drm/bochs: phase 3: use atomic .set_config helper John Hunter
2015-07-16 12:20 ` [PATCH 6/8] drm/bochs: phase 3: provide a custom ->atomic_commit implementation John Hunter
2015-07-17 6:08 ` Pekka Paalanen
2015-07-19 23:56 ` John Hunter
2015-07-20 0:20 ` Stéphane Marchesin
2015-07-20 7:46 ` Pekka Paalanen
2015-07-20 8:58 ` Stéphane Marchesin
2015-07-20 9:35 ` KMS timings (Re: [PATCH 6/8] drm/bochs: phase 3: provide a custom ->atomic_commit implementation) Pekka Paalanen
2015-07-20 14:21 ` Daniel Vetter
2015-07-20 17:32 ` Stéphane Marchesin
2015-07-21 7:06 ` Pekka Paalanen
2015-07-21 9:02 ` Daniel Vetter
2015-07-21 11:22 ` Pekka Paalanen
2015-07-21 13:47 ` Daniel Vetter
2015-07-16 12:20 ` [PATCH 7/8] drm/bochs: phase 3: switch to drm_atomic_helper_page_flip John Hunter
2015-07-16 12:20 ` John Hunter [this message]
2016-03-02 10:13 ` [PATCH 0/8] drm/bochs: convert bochs to atomic mode-setting Emil Velikov
2016-03-02 15:38 ` Gerd Hoffmann
2016-03-02 18:02 ` Emil Velikov
2016-03-03 9:28 ` Gerd Hoffmann
2016-03-04 8:31 ` John Hunter
2016-03-04 14:05 ` Emil Velikov
2016-03-07 9:34 ` Gerd Hoffmann
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=1437049241-11972-9-git-send-email-zhjwpku@gmail.com \
--to=zhjwpku@gmail.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.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).