From patchwork Sat Apr 23 07:37:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 12824431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C07B7C433FE for ; Sat, 23 Apr 2022 07:37:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1443B112385; Sat, 23 Apr 2022 07:37:38 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 8E247112385 for ; Sat, 23 Apr 2022 07:37:36 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.90,284,1643641200"; d="scan'208";a="118891575" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 23 Apr 2022 16:37:34 +0900 Received: from localhost.localdomain (unknown [10.226.92.16]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id AD4E14008C4E; Sat, 23 Apr 2022 16:37:30 +0900 (JST) From: Biju Das To: David Airlie , Daniel Vetter Subject: [PATCH] drm: rcar-du: Add setting to PnALPHAR register on Gen3 Date: Sat, 23 Apr 2022 08:37:28 +0100 Message-Id: <20220423073728.111808-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Paterson , Geert Uytterhoeven , Prabhakar Mahadev Lad , dri-devel@lists.freedesktop.org, Biju Das , linux-renesas-soc@vger.kernel.org, Kieran Bingham , Laurent Pinchart , Biju Das , LUU HOAI Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: LUU HOAI In Gen3, when Alpha blend is enabled in the PnMR register, depending on the initial value of the PnALPHAR register, either channel of DU might be black screen. Therefore, this patch prevents the black screen by setting the PnALPHAR register to all 0. In addition, PnALPHAR register will be released in the R-Car Gen3 Hardware Manual Rev 2.4 (Sep. 2021). Signed-off-by: LUU HOAI Signed-off-by: Biju Das --- This patch is based on [1] [1] https://github.com/renesas-rcar/linux-bsp/commit/fcb34fe338cbde0a64919430733541035f20a784 Not sure this patches has to go with Fixes tag for stable?? Tested the changes on RZ/G2M board root@hihope-rzg2m:/cip-test-scripts# modetest -M rcar-du -w 54:alpha:55555 root@hihope-rzg2m:/cip-test-scripts# modetest -M rcar-du -s "93@90:1024x768@AR24" -d -P "54@90:400x300+200+200@XR24" setting mode 1024x768-75Hz@AR24 on connectors 93, crtc 90 testing 400x300@XR24 overlay plane 54 --- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index 5c1c7bb04f3f..aff39b9253f8 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c @@ -510,6 +510,12 @@ static void rcar_du_plane_setup_format_gen3(struct rcar_du_group *rgrp, rcar_du_plane_write(rgrp, index, PnDDCR4, state->format->edf | PnDDCR4_CODE); + + /* In Gen3, PnALPHAR register need to be set to 0 + * to avoid black screen issue when alpha blend is enable + * on DU module + */ + rcar_du_plane_write(rgrp, index, PnALPHAR, 0x00000000); } static void rcar_du_plane_setup_format(struct rcar_du_group *rgrp,