From patchwork Wed Aug 5 07:22:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hunter X-Patchwork-Id: 6946711 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 097B1C05AC for ; Wed, 5 Aug 2015 07:23:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2A4EF20253 for ; Wed, 5 Aug 2015 07:22:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 35F7120443 for ; Wed, 5 Aug 2015 07:22:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 00C756E696; Wed, 5 Aug 2015 00:22:56 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from pku.edu.cn (mx12.pku.edu.cn [162.105.129.175]) by gabe.freedesktop.org (Postfix) with ESMTP id 48DD36E03D for ; Wed, 5 Aug 2015 00:22:54 -0700 (PDT) Received: from debian.localdomain (unknown [59.108.92.109]) by mailfront03 (Coremail) with SMTP id 84FpogD3qGXKucFVsbTDAA--.56129S7; Wed, 05 Aug 2015 15:22:51 +0800 (CST) From: John Hunter To: dri-devel@lists.freedesktop.org Subject: [PATCH 5/7] drm/cirrus: phase 3: use atomic .set_config helper Date: Wed, 5 Aug 2015 15:22:54 +0800 Message-Id: <1438759376-4509-6-git-send-email-zhjwpku@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1438759376-4509-1-git-send-email-zhjwpku@gmail.com> References: <1438759376-4509-1-git-send-email-zhjwpku@gmail.com> X-CM-TRANSID: 84FpogD3q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W8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU5fl1JUUUUU== X-CM-SenderInfo: p2km411nx6wzxdlohudrp/ Cc: Daniel Vetter , Matthew Garrett , Dave Airlie X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Zhao Junwang 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 Cc: Gerd Hoffmann Cc: Matthew Garrett Cc: Dave Airlie Signed-off-by: Zhao Junwang --- 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, };