dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: John Hunter <zhjwpku@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Matthew Garrett <mjg59@coreos.com>,
	Dave Airlie <airlied@redhat.com>
Subject: [PATCH 5/7] drm/cirrus: phase 3: use atomic .set_config helper
Date: Wed,  5 Aug 2015 15:22:54 +0800	[thread overview]
Message-ID: <1438759376-4509-6-git-send-email-zhjwpku@gmail.com> (raw)
In-Reply-To: <1438759376-4509-1-git-send-email-zhjwpku@gmail.com>

From: Zhao Junwang <zhjwpku@gmail.com>

Now that phase 1 and phase 2 are completed, switch .set_config
helper to use the atomic one.

-stop looking legacy crtc->primary->fb, instead we should use
crtc->primary->state->fb

.prepare() calls are no more needed, remove them
.mode_set() and .mode_set_base are no longer needed, remove

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Matthew Garrett <mjg59@coreos.com>
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Zhao Junwang <zhjwpku@gmail.com>
---
 drivers/gpu/drm/cirrus/cirrus_mode.c |   28 ++++++----------------------
 1 file changed, 6 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c
index e8f038b..1775864 100644
--- a/drivers/gpu/drm/cirrus/cirrus_mode.c
+++ b/drivers/gpu/drm/cirrus/cirrus_mode.c
@@ -208,7 +208,8 @@ static void cirrus_crtc_mode_set_nofb(struct drm_crtc *crtc)
 	sr07 = RREG8(SEQ_DATA);
 	sr07 &= 0xe0;
 	hdr = 0;
-	switch (crtc->primary->fb->bits_per_pixel) {
+
+	switch (crtc->primary->state->fb->bits_per_pixel) {
 	case 8:
 		sr07 |= 0x11;
 		break;
@@ -231,13 +232,13 @@ static void cirrus_crtc_mode_set_nofb(struct drm_crtc *crtc)
 	WREG_SEQ(0x7, sr07);
 
 	/* Program the pitch */
-	tmp = crtc->primary->fb->pitches[0] / 8;
+	tmp = crtc->primary->state->fb->pitches[0] / 8;
 	WREG_CRT(VGA_CRTC_OFFSET, tmp);
 
 	/* Enable extended blanking and pitch bits, and enable full memory */
 	tmp = 0x22;
-	tmp |= (crtc->primary->fb->pitches[0] >> 7) & 0x10;
-	tmp |= (crtc->primary->fb->pitches[0] >> 6) & 0x40;
+	tmp |= (crtc->primary->state->fb->pitches[0] >> 7) & 0x10;
+	tmp |= (crtc->primary->state->fb->pitches[0] >> 6) & 0x40;
 	WREG_CRT(0x1b, tmp);
 
 	/* Enable high-colour modes */
@@ -253,15 +254,6 @@ static void cirrus_crtc_mode_set_nofb(struct drm_crtc *crtc)
 }
 
 /*
- * This is called before a mode is programmed. A typical use might be to
- * enable DPMS during the programming to avoid seeing intermediate stages,
- * but that's not relevant to us
- */
-static void cirrus_crtc_prepare(struct drm_crtc *crtc)
-{
-}
-
-/*
  * This is called after a mode is programmed. It should reverse anything done
  * by the prepare function
  */
@@ -303,7 +295,7 @@ static void cirrus_crtc_destroy(struct drm_crtc *crtc)
 /* These provide the minimum set of functions required to handle a CRTC */
 static const struct drm_crtc_funcs cirrus_crtc_funcs = {
 	.gamma_set = cirrus_crtc_gamma_set,
-	.set_config = drm_crtc_helper_set_config,
+	.set_config = drm_atomic_helper_set_config,
 	.destroy = cirrus_crtc_destroy,
 	.reset = drm_atomic_helper_crtc_reset,
 	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
@@ -313,10 +305,7 @@ static const struct drm_crtc_funcs cirrus_crtc_funcs = {
 static const struct drm_crtc_helper_funcs cirrus_helper_funcs = {
 	.dpms = cirrus_crtc_dpms,
 	.mode_fixup = cirrus_crtc_mode_fixup,
-	.mode_set = drm_helper_crtc_mode_set,
-	.mode_set_base = drm_helper_crtc_mode_set_base,
 	.mode_set_nofb = cirrus_crtc_mode_set_nofb,
-	.prepare = cirrus_crtc_prepare,
 	.commit = cirrus_crtc_commit,
 	.load_lut = cirrus_crtc_load_lut,
 };
@@ -506,10 +495,6 @@ static void cirrus_encoder_dpms(struct drm_encoder *encoder, int state)
 	return;
 }
 
-static void cirrus_encoder_prepare(struct drm_encoder *encoder)
-{
-}
-
 static void cirrus_encoder_commit(struct drm_encoder *encoder)
 {
 }
@@ -525,7 +510,6 @@ static const struct drm_encoder_helper_funcs cirrus_encoder_helper_funcs = {
 	.dpms = cirrus_encoder_dpms,
 	.mode_fixup = cirrus_encoder_mode_fixup,
 	.mode_set = cirrus_encoder_mode_set,
-	.prepare = cirrus_encoder_prepare,
 	.commit = cirrus_encoder_commit,
 };
 
-- 
1.7.10.4


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2015-08-05  7:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05  7:22 [PATCH 0/7] drm/cirrus: convert cirrus to atomic mode-setting John Hunter
2015-08-05  7:22 ` [PATCH 1/7] drm/cirrus: phase 1 - use the transitional helpers John Hunter
2015-08-05  7:22 ` [PATCH 2/7] drm/cirrus: phase 2: wire up state reset, duplicate and destroy John Hunter
2015-08-05  7:22 ` [PATCH 3/7] drm/cirrus: phase 3: atomic updates of planes John Hunter
2015-08-05  7:22 ` [PATCH 4/7] drm/cirrus: add return 0 to make sure if (bo->pin_count) early_exit John Hunter
2015-08-05  7:22 ` John Hunter [this message]
2015-08-05  7:22 ` [PATCH 6/7] drm/cirrus: atomic dpms support John Hunter
2015-08-05  7:22 ` [PATCH 7/7] drm/cirrus: add DRIVER_ATOMIC to .driver_features John Hunter
  -- strict thread matches above, loose matches on Subject: below --
2015-07-30 10:08 [PATCH 0/7] drm/cirrus: convert cirrus to atomic mode-setting John Hunter
2015-07-30 10:08 ` [PATCH 5/7] drm/cirrus: phase 3: use atomic .set_config helper John Hunter

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=1438759376-4509-6-git-send-email-zhjwpku@gmail.com \
    --to=zhjwpku@gmail.com \
    --cc=airlied@redhat.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mjg59@coreos.com \
    /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).