Message ID | 20221209091143.6290-1-jammy_huang@aspeedtech.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp666998wrr; Fri, 9 Dec 2022 01:21:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf5e7PBL0Cv8Hfgv6JNRHRsBMhNE8ue9mng45g6bRraIMLbVxgDKIkZ9w0G/XJhQLr37DEEN X-Received: by 2002:a17:902:6bcc:b0:188:5b7d:738a with SMTP id m12-20020a1709026bcc00b001885b7d738amr4860850plt.29.1670577667067; Fri, 09 Dec 2022 01:21:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670577667; cv=none; d=google.com; s=arc-20160816; b=pE7Ye4l0i4ozunWAIvZPYRnZeRBwVrrUJ2xMGfMuzMlmpE5NABc+rGPsBCdJDh+4UR 0dae5ZNaJvHzze704Xs4BoOUOOTboXJ6Hla6Q/IiqOUMywSUquCUqnMfaaOipo8ksIkZ tmSoBE09huccsjwYFwyOcpdO20Pm0HdwKYcoZ7yei2ptr4m9OxsiBQU7epEaP4Om3qiT CkCb040lWgUM5OOb03lTrJyjaaEOuGSvsPJVZX1g0vXHtAxR5gShKgnkjmHQ2buZS/xZ MzsV+IwIXhMfcC/ga/OssarEqqhC1t7EZUcH1HOoSR7vAaAgfej3As69FCCZTDOB0rrY rLRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=KbIHloySNng+J0PZPEXK37HBCUDwAKAZk4Fsr1Oz1vw=; b=0yn9lw+Gxktellex4xO4+FVjGejCa4DHHlXNm6F8t3gCCEGoZ0be+AZsfQLysdxGX/ hKw8A5RzzJZp8/y/dedZz2cGD1RqcnEJPkzuiM0zujWkCruYVxihoQLM2vYnq67iS6hY BCSo/JZ5W9VHFZPV1wVit60UELh8nMPHvczOSlDGmVCtzyzE6LfgDUXvexxBmwnmsW5T CGv2FbfTSl0KZZtpEvhdsIAdJ2K6HsiSZQK5zaKftHrGZ9eOgrKKrqNOwDNjPdSheEvl VmzAlDG6fyf+AKpaK06YgHPn33kmrlE92+x2jCCQCoZ8LUIgdYsINfWLw0Pzg2E1nFnM zPyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020a17090341c400b0017f7fffb591si1201616ple.374.2022.12.09.01.20.54; Fri, 09 Dec 2022 01:21:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229791AbiLIJLg (ORCPT <rfc822;sophiezhao968@gmail.com> + 99 others); Fri, 9 Dec 2022 04:11:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229568AbiLIJLb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 9 Dec 2022 04:11:31 -0500 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5090554C3 for <linux-kernel@vger.kernel.org>; Fri, 9 Dec 2022 01:11:28 -0800 (PST) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 2B992MCj011858; Fri, 9 Dec 2022 17:02:22 +0800 (GMT-8) (envelope-from jammy_huang@aspeedtech.com) Received: from JammyHuang-PC.aspeed.com (192.168.2.115) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 9 Dec 2022 17:10:51 +0800 From: Jammy Huang <jammy_huang@aspeedtech.com> To: <airlied@redhat.com>, <tzimmermann@suse.de>, <airlied@gmail.com>, <daniel@ffwll.ch>, <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH] drm/ast: Fix no display at WayLand after power-off Date: Fri, 9 Dec 2022 17:11:43 +0800 Message-ID: <20221209091143.6290-1-jammy_huang@aspeedtech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.2.115] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 2B992MCj011858 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751727647787073314?= X-GMAIL-MSGID: =?utf-8?q?1751727647787073314?= |
Series |
drm/ast: Fix no display at WayLand after power-off
|
|
Commit Message
Jammy Huang
Dec. 9, 2022, 9:11 a.m. UTC
With WayLand, there is error log when display waken up from power-off:
gnome-shell: Failed to post KMS update: CRTC property (GAMMA_LUT) not found
gnome-shell: Page flip discarded: CRTC property (GAMMA_LUT) not found
To fix the issue, enable GAMMA_LUT property on CRTC.
Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
---
drivers/gpu/drm/ast/ast_drv.h | 2 ++
drivers/gpu/drm/ast/ast_mode.c | 5 +++--
2 files changed, 5 insertions(+), 2 deletions(-)
base-commit: 8ed710da2873c2aeb3bb805864a699affaf1d03b
Comments
Hi Am 09.12.22 um 10:11 schrieb Jammy Huang: > With WayLand, there is error log when display waken up from power-off: > gnome-shell: Failed to post KMS update: CRTC property (GAMMA_LUT) not found > gnome-shell: Page flip discarded: CRTC property (GAMMA_LUT) not found > > To fix the issue, enable GAMMA_LUT property on CRTC. This code has long been replaced by commit ce7fcf700386 ("drm/ast: Add Atomic gamma lut support for aspeed"), which adds proper color management to ast. Please only submit patches for the latest driver in drm-misc-next. Best regards Thomas > > Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com> > --- > drivers/gpu/drm/ast/ast_drv.h | 2 ++ > drivers/gpu/drm/ast/ast_mode.c | 5 +++-- > 2 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h > index 2e44b971c3a6..fd9af1cf0563 100644 > --- a/drivers/gpu/drm/ast/ast_drv.h > +++ b/drivers/gpu/drm/ast/ast_drv.h > @@ -86,6 +86,8 @@ enum ast_tx_chip { > #define AST_DRAM_4Gx16 7 > #define AST_DRAM_8Gx16 8 > > +#define MAX_COLOR_LUT_ENTRIES 256 > + > /* > * Cursor plane > */ > diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c > index 1bc0220e6783..87bd9697bb44 100644 > --- a/drivers/gpu/drm/ast/ast_mode.c > +++ b/drivers/gpu/drm/ast/ast_mode.c > @@ -74,7 +74,7 @@ static void ast_crtc_load_lut(struct ast_private *ast, struct drm_crtc *crtc) > g = r + crtc->gamma_size; > b = g + crtc->gamma_size; > > - for (i = 0; i < 256; i++) > + for (i = 0; i < MAX_COLOR_LUT_ENTRIES; i++) > ast_load_palette_index(ast, i, *r++ >> 8, *g++ >> 8, *b++ >> 8); > } > > @@ -1323,7 +1323,8 @@ static int ast_crtc_init(struct drm_device *dev) > if (ret) > return ret; > > - drm_mode_crtc_set_gamma_size(crtc, 256); > + drm_crtc_enable_color_mgmt(crtc, 0, false, MAX_COLOR_LUT_ENTRIES); > + drm_mode_crtc_set_gamma_size(crtc, MAX_COLOR_LUT_ENTRIES); > drm_crtc_helper_add(crtc, &ast_crtc_helper_funcs); > > return 0; > > base-commit: 8ed710da2873c2aeb3bb805864a699affaf1d03b -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev
Hi Thomas, OK. Thanks for the reminder. On 2022/12/9 下午 05:45, Thomas Zimmermann wrote: > Hi > > Am 09.12.22 um 10:11 schrieb Jammy Huang: >> With WayLand, there is error log when display waken up from power-off: >> gnome-shell: Failed to post KMS update: CRTC property (GAMMA_LUT) not >> found >> gnome-shell: Page flip discarded: CRTC property (GAMMA_LUT) not found >> >> To fix the issue, enable GAMMA_LUT property on CRTC. > > This code has long been replaced by commit ce7fcf700386 ("drm/ast: Add > Atomic gamma lut support for aspeed"), which adds proper color > management to ast. > > Please only submit patches for the latest driver in drm-misc-next. > > Best regards > Thomas > >> >> Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com> >> --- >> drivers/gpu/drm/ast/ast_drv.h | 2 ++ >> drivers/gpu/drm/ast/ast_mode.c | 5 +++-- >> 2 files changed, 5 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/ast/ast_drv.h >> b/drivers/gpu/drm/ast/ast_drv.h >> index 2e44b971c3a6..fd9af1cf0563 100644 >> --- a/drivers/gpu/drm/ast/ast_drv.h >> +++ b/drivers/gpu/drm/ast/ast_drv.h >> @@ -86,6 +86,8 @@ enum ast_tx_chip { >> #define AST_DRAM_4Gx16 7 >> #define AST_DRAM_8Gx16 8 >> +#define MAX_COLOR_LUT_ENTRIES 256 >> + >> /* >> * Cursor plane >> */ >> diff --git a/drivers/gpu/drm/ast/ast_mode.c >> b/drivers/gpu/drm/ast/ast_mode.c >> index 1bc0220e6783..87bd9697bb44 100644 >> --- a/drivers/gpu/drm/ast/ast_mode.c >> +++ b/drivers/gpu/drm/ast/ast_mode.c >> @@ -74,7 +74,7 @@ static void ast_crtc_load_lut(struct ast_private >> *ast, struct drm_crtc *crtc) >> g = r + crtc->gamma_size; >> b = g + crtc->gamma_size; >> - for (i = 0; i < 256; i++) >> + for (i = 0; i < MAX_COLOR_LUT_ENTRIES; i++) >> ast_load_palette_index(ast, i, *r++ >> 8, *g++ >> 8, *b++ >> >> 8); >> } >> @@ -1323,7 +1323,8 @@ static int ast_crtc_init(struct drm_device *dev) >> if (ret) >> return ret; >> - drm_mode_crtc_set_gamma_size(crtc, 256); >> + drm_crtc_enable_color_mgmt(crtc, 0, false, MAX_COLOR_LUT_ENTRIES); >> + drm_mode_crtc_set_gamma_size(crtc, MAX_COLOR_LUT_ENTRIES); >> drm_crtc_helper_add(crtc, &ast_crtc_helper_funcs); >> return 0; >> >> base-commit: 8ed710da2873c2aeb3bb805864a699affaf1d03b >
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index 2e44b971c3a6..fd9af1cf0563 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h @@ -86,6 +86,8 @@ enum ast_tx_chip { #define AST_DRAM_4Gx16 7 #define AST_DRAM_8Gx16 8 +#define MAX_COLOR_LUT_ENTRIES 256 + /* * Cursor plane */ diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index 1bc0220e6783..87bd9697bb44 100644 --- a/drivers/gpu/drm/ast/ast_mode.c +++ b/drivers/gpu/drm/ast/ast_mode.c @@ -74,7 +74,7 @@ static void ast_crtc_load_lut(struct ast_private *ast, struct drm_crtc *crtc) g = r + crtc->gamma_size; b = g + crtc->gamma_size; - for (i = 0; i < 256; i++) + for (i = 0; i < MAX_COLOR_LUT_ENTRIES; i++) ast_load_palette_index(ast, i, *r++ >> 8, *g++ >> 8, *b++ >> 8); } @@ -1323,7 +1323,8 @@ static int ast_crtc_init(struct drm_device *dev) if (ret) return ret; - drm_mode_crtc_set_gamma_size(crtc, 256); + drm_crtc_enable_color_mgmt(crtc, 0, false, MAX_COLOR_LUT_ENTRIES); + drm_mode_crtc_set_gamma_size(crtc, MAX_COLOR_LUT_ENTRIES); drm_crtc_helper_add(crtc, &ast_crtc_helper_funcs); return 0;