Received: by 10.223.185.116 with SMTP id b49csp4188300wrg; Mon, 26 Feb 2018 12:50:34 -0800 (PST) X-Google-Smtp-Source: AH8x225p++pP5s7c8Al8FV35QWEzgcwMDwf6QoESXSGfeteR+aGlB11KDb39fP4uqriX/jhcnTIr X-Received: by 2002:a17:902:22cc:: with SMTP id o12-v6mr11968104plg.280.1519678234037; Mon, 26 Feb 2018 12:50:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519678234; cv=none; d=google.com; s=arc-20160816; b=YxI94LYWZTt1U3IFI+PQnBW2sjBUwOSDtdmd2jJ6mbUna9VFhsDJdeQvD+SGBhd9vO Enq++3A7FGXIQywTyUL9kf/PM8fOxu3Zqo2EE72xF8ExUpKPisGYEKxtcVrU9HZs6NJP LaX7c3rv7fiABhkpvU0DofpYAab4CID7HBYdLEzvQAy7ckA0cG5fHCK992p6uz50vF8j UTiCLSqDVTCdp+g4+iFx+xsySKuCkbX/U4FV5xY3qyH0K8gpIl3lPbc7ShvC9IJ7zlpC hrzSl2z/n4CHr4WJ3F96bcEeJ73X9oufoE3xM1wqRZg26c3ziEYvViWTOL5QrwNz9TGm m0gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=q4wB0YmSDwOBztRFjaFk/5uyfCzB2WIoX1yGuQK4+PM=; b=tf16OifflK0dVd+BysYNAlTKX1W+TrjEdSWjnmjjhhj8GnaupqNRasISFohOROis+x oIKY0Zi9y1WJR0gKxQNKigMg1gHlgZYqvZuPHdn3uA3fFNRfPpKiYSBuaGTqSh/WujRL QxCLpEZl9UXuMTDnG47ASZxH60V8s7E/RxCHVspnJQzfnSuGpGQA+1JTD6WdUJLx321+ Xc4OCrCNJyoXVNuqsQcWsbYnim726nROZNygxTX1dvIQSjp1T/itjirqymbiWkvsuXq/ wyOILamryGS9jhgWT2d0AyXonUdvaHEki6pCCCiub97lMFefAobwup4qyDbXERmt4k8r mPIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n61-v6si7288633plb.797.2018.02.26.12.50.17; Mon, 26 Feb 2018 12:50:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753120AbeBZUZL (ORCPT + 99 others); Mon, 26 Feb 2018 15:25:11 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35352 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753101AbeBZUZH (ORCPT ); Mon, 26 Feb 2018 15:25:07 -0500 Received: from localhost (clnet-b04-243.ikbnet.co.at [83.175.124.243]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id AB6F6FAD; Mon, 26 Feb 2018 20:25:06 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Rosin , Daniel Vetter , Daniel Vetter , Gerd Hoffmann Subject: [PATCH 4.14 46/54] drm/cirrus: Load lut in crtc_commit Date: Mon, 26 Feb 2018 21:22:23 +0100 Message-Id: <20180226202146.715891524@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180226202144.375869933@linuxfoundation.org> References: <20180226202144.375869933@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Daniel Vetter commit 745fd50f3b044db6a3922e1718306555613164b0 upstream. In the past the ast driver relied upon the fbdev emulation helpers to call ->load_lut at boot-up. But since commit b8e2b0199cc377617dc238f5106352c06dcd3fa2 Author: Peter Rosin Date: Tue Jul 4 12:36:57 2017 +0200 drm/fb-helper: factor out pseudo-palette that's cleaned up and drivers are expected to boot into a consistent lut state. This patch fixes that. Fixes: b8e2b0199cc3 ("drm/fb-helper: factor out pseudo-palette") Cc: Peter Rosin Cc: Daniel Vetter Cc: # v4.14+ References: https://bugzilla.kernel.org/show_bug.cgi?id=198123 Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20180131110450.22153-1-daniel.vetter@ffwll.ch Signed-off-by: Gerd Hoffmann Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/cirrus/cirrus_mode.c | 40 ++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c @@ -294,22 +294,7 @@ static void cirrus_crtc_prepare(struct d { } -/* - * This is called after a mode is programmed. It should reverse anything done - * by the prepare function - */ -static void cirrus_crtc_commit(struct drm_crtc *crtc) -{ -} - -/* - * The core can pass us a set of gamma values to program. We actually only - * use this for 8-bit mode so can't perform smooth fades on deeper modes, - * but it's a requirement that we provide the function - */ -static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, - u16 *blue, uint32_t size, - struct drm_modeset_acquire_ctx *ctx) +static void cirrus_crtc_load_lut(struct drm_crtc *crtc) { struct drm_device *dev = crtc->dev; struct cirrus_device *cdev = dev->dev_private; @@ -317,7 +302,7 @@ static int cirrus_crtc_gamma_set(struct int i; if (!crtc->enabled) - return 0; + return; r = crtc->gamma_store; g = r + crtc->gamma_size; @@ -330,6 +315,27 @@ static int cirrus_crtc_gamma_set(struct WREG8(PALETTE_DATA, *g++ >> 8); WREG8(PALETTE_DATA, *b++ >> 8); } +} + +/* + * This is called after a mode is programmed. It should reverse anything done + * by the prepare function + */ +static void cirrus_crtc_commit(struct drm_crtc *crtc) +{ + cirrus_crtc_load_lut(crtc); +} + +/* + * The core can pass us a set of gamma values to program. We actually only + * use this for 8-bit mode so can't perform smooth fades on deeper modes, + * but it's a requirement that we provide the function + */ +static int cirrus_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, + u16 *blue, uint32_t size, + struct drm_modeset_acquire_ctx *ctx) +{ + cirrus_crtc_load_lut(crtc); return 0; }