From patchwork Wed Dec 11 15:49:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Yacoub X-Patchwork-Id: 11287623 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8C47A6C1 for ; Thu, 12 Dec 2019 08:55:15 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 69DAE214AF for ; Thu, 12 Dec 2019 08:55:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="m2NiP0Cn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 69DAE214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9261D6ECB4; Thu, 12 Dec 2019 08:55:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 248BF89415 for ; Wed, 11 Dec 2019 15:49:14 +0000 (UTC) Received: by mail-yb1-xb49.google.com with SMTP id b5so7601731ybq.23 for ; Wed, 11 Dec 2019 07:49:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=+84MmMAoxZMowKg1LejiSRn+LGavX3XL0RXX6IMOW+w=; b=m2NiP0CnGnotNR/yMx/w5OIeIfCUnZkQxMGnHlJQgBxOA/FXbl7y2EYygJSnUU7MrL kJ3L4rLG6BKMC6Kw7F601lW847yaNWWQzxCbN9s1MYJ/eu1LeC5BesWLk3yZ3tt2FePN 92VLc8xSfXsMFhJ4ItMCqBRqc7K/K40iD+AjeKs7eASl25E05/A0xRwMtATFIE75BGE0 P6839NDZrpb/tdJSU3vkmmUS+e7YjYoAGICMyToI9z5hc49ilIEE5SPTUDNcmV8niTEb HhHa8oIT6pJcepbPvKt2SuJctQ0v2091Cw9qWrvd7TEfd5roezf2Rd0FvxgpGZFv/pLU wWkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=+84MmMAoxZMowKg1LejiSRn+LGavX3XL0RXX6IMOW+w=; b=Kla/7GuF5hutb9514oyalQbFGMCxLhNYPdNqBu/uVJN5SNscOadUdaWRYG6TmuO9LL JY2avBqikoXCGg9ZUn8vcZxiFYKCzzM5MDU8Ab13cSQMg86mexsYZB0hGaqZ0BRtJXfD 8NU7tl/nJUEs2/dest5U0frbGyIYRIKHLcq6MeqGkjNkDd8zWaIYOWf1I51lA4sYrC/P hZkIs8huAELJ9Fa7qZ56oFZwjwLZGAeNo9i70XV4slZqnAF6eKJZUeC3ht8HMlVJnCal PaCAUbrzzZAlLIcXoghkPW4JhxW3XUE9Pq9WnNZrDO3k0U5fyv6moL2Ycc79nG7kF/Yz 5Mig== X-Gm-Message-State: APjAAAUyHVRSCQyNXPSnjJ43t7FGALUdIPUArK7xGHga9EhvegyyDgR4 l9cwsD4zhRGdhAjN3QYj1YvZI5HM+6LZ/vSa X-Google-Smtp-Source: APXvYqzgag2uEK1TrKN/WHaL/XtHsyuWNO7uPzN29U6f0LWDaOKfxY1Ep76cMLNac+NAL6BSwAjUWiYDY6LG4QTQ X-Received: by 2002:a0d:d247:: with SMTP id u68mr297158ywd.1.1576079353136; Wed, 11 Dec 2019 07:49:13 -0800 (PST) Date: Wed, 11 Dec 2019 10:49:00 -0500 Message-Id: <20191211154901.176256-1-markyacoub@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.24.0.525.g8f36a354ae-goog Subject: [PATCH 1/2] Return from mtk_ovl_layer_config after mtk_ovl_layer_off From: Mark Yacoub To: CK Hu , dri-devel@lists.freedesktop.org X-Mailman-Approved-At: Thu, 12 Dec 2019 08:55:06 +0000 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: Daniele Castagna , David Airlie , Sean Paul , Matthias Brugger , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Mark Yacoub Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" drm/mediatek: return if plane pending state is disabled. If the plane pending state is disabled, call mtk_ovl_layer_off then return. This guarantees that that the state is valid for all operations when the pending state is enabled. Suggested-by: Sean Paul To: CK Hu To: dri-devel@lists.freedesktop.org Cc: Daniele Castagna Cc: Philipp Zabel Cc: David Airlie Cc: Daniel Vetter Cc: Matthias Brugger Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Signed-off-by: Mark Yacoub Reviewed-by: Sean Paul --- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index 4a55bb6e2213..526b595eeff9 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c @@ -260,8 +260,10 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx, unsigned int src_size = (pending->height << 16) | pending->width; unsigned int con; - if (!pending->enable) + if (!pending->enable) { mtk_ovl_layer_off(comp, idx); + return; + } con = ovl_fmt_convert(ovl, fmt); if (idx != 0) @@ -283,8 +285,7 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx, writel_relaxed(offset, comp->regs + DISP_REG_OVL_OFFSET(idx)); writel_relaxed(addr, comp->regs + DISP_REG_OVL_ADDR(ovl, idx)); - if (pending->enable) - mtk_ovl_layer_on(comp, idx); + mtk_ovl_layer_on(comp, idx); } static void mtk_ovl_bgclr_in_on(struct mtk_ddp_comp *comp) From patchwork Wed Dec 11 15:49:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Yacoub X-Patchwork-Id: 11287631 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C124E6C1 for ; Thu, 12 Dec 2019 08:55:42 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9F9EB214AF for ; Thu, 12 Dec 2019 08:55:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="T7tmarUt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F9EB214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 845C06ECC6; Thu, 12 Dec 2019 08:55:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qv1-xf49.google.com (mail-qv1-xf49.google.com [IPv6:2607:f8b0:4864:20::f49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2B44E6EB7B for ; Wed, 11 Dec 2019 15:49:18 +0000 (UTC) Received: by mail-qv1-xf49.google.com with SMTP id r9so9154874qvs.19 for ; Wed, 11 Dec 2019 07:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=L3bqEDJc/83H6XSH4dKpp4Sz+uUocCwUuCh066ZPD24=; b=T7tmarUt73QPvvzsmlX8joprU84Bgn+q+g3Bub5VpNuPOkJ2OMgW/GR2NfK7AzKClC TVaQfOgipbhJkxSaBENCKqcs/xBqhcht6ipt8vpVxU8N0K7LDCJSrRC/1rsFS9tb+m1i xrDG46KfHWOx7stN/zivVYevObR3Lt28+6MPEh3++sYAWKHfWyyPtHWT99FEvqBwKUsk /2L6mMknwQVjBCXY2SHvUs9Tq7wghQ+mqZ1/jCay1ViVuWUsLkq7UxOQEwPovdQGJZDZ bvwP7rUww+runAY6qHX8Fl4Plmaut9fSbirsX6AWRHXQ1HGlqeCzE2/4WMjMeqTZd74Z Ssjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=L3bqEDJc/83H6XSH4dKpp4Sz+uUocCwUuCh066ZPD24=; b=DAarHB13ty17n7evqjubUkVCDkValTF/BVz1ZTjP1vsxYkiHIqp+KOMUY/2NUyBQJz YfBxPNBLR945+lrgQ/C9EAETesWQmad8FoJKdnmgy6WEUVOAotRjaeidbdrs6C2Y+QMa jfG8gj5uJo9s77DZ8hYAk902tulH/xV2PCEsubMzcZw1TXe6I8lBUTiBNCreidR9Cwq+ iIQ5HFUxgzUZGRRS60vICPpR7rNN6BmCL8+aVR51XXpY6VP2IhPv0Nl9zi3sLuqQHi9N EhA18uFKqOBVSb7Hrh45fz/9kXX4MgF7V/4t8TXe9qZpMsFe304xYoO7i1F8WxNJx1jV qHuQ== X-Gm-Message-State: APjAAAXhxRkQF8EFeUUE8tdfVBok+ca2f1ZLbXuq32WINQd+iI058rn4 cWZwDhdJWQrrwmtJvpLmsm1lIHtOFaQdzRXv X-Google-Smtp-Source: APXvYqzWVPRzbCutVlIWkKgo8ZdWbTIe/i8BsJDaINwYPE1tnMGWPJw4+4d/x/wDNk8QtVgjgmAdkZUNDVCj/ebY X-Received: by 2002:a0c:d0f1:: with SMTP id b46mr3637071qvh.188.1576079357145; Wed, 11 Dec 2019 07:49:17 -0800 (PST) Date: Wed, 11 Dec 2019 10:49:01 -0500 In-Reply-To: <20191211154901.176256-1-markyacoub@google.com> Message-Id: <20191211154901.176256-2-markyacoub@google.com> Mime-Version: 1.0 References: <20191211154901.176256-1-markyacoub@google.com> X-Mailer: git-send-email 2.24.0.525.g8f36a354ae-goog Subject: [PATCH 2/2] Turn off Alpha bit when plane format has no alpha From: Mark Yacoub To: CK Hu , dri-devel@lists.freedesktop.org X-Mailman-Approved-At: Thu, 12 Dec 2019 08:55:06 +0000 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: Daniele Castagna , David Airlie , Sean Paul , Matthias Brugger , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Mark Yacoub Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" drm/mediatek: Add OVL_CON_ALPHA only when the plane format has_alpha. This change enables XR24 format to be displayed as an overlay on top of the primary plane. Suggested-by: Sean Paul To: CK Hu To: dri-devel@lists.freedesktop.org Cc: Daniele Castagna Cc: Philipp Zabel Cc: David Airlie Cc: Daniel Vetter Cc: Matthias Brugger Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Signed-off-by: Mark Yacoub --- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index 526b595eeff9..a7851756dddf 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c @@ -266,7 +266,7 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx, } con = ovl_fmt_convert(ovl, fmt); - if (idx != 0) + if (state->base.fb->format->has_alpha) con |= OVL_CON_AEN | OVL_CON_ALPHA; if (pending->rotation & DRM_MODE_REFLECT_Y) {