From patchwork Tue Aug 21 12:24:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sravanthi Kollukuduru X-Patchwork-Id: 10571465 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 916EF921 for ; Tue, 21 Aug 2018 12:24:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 893452A0F1 for ; Tue, 21 Aug 2018 12:24:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 874932A11B; Tue, 21 Aug 2018 12:24:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27E1A2A0F1 for ; Tue, 21 Aug 2018 12:24:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727439AbeHUPoa (ORCPT ); Tue, 21 Aug 2018 11:44:30 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:49942 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726590AbeHUPoa (ORCPT ); Tue, 21 Aug 2018 11:44:30 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2F20D61476; Tue, 21 Aug 2018 12:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1534854273; bh=sQFyqJppBwlKkKU3YCsz8jiM5bcFhPOIs6iV/641l4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l4w99S2tlJFbOrsp6KO4n/GCKRZnDLxBHaBcWXMXp3kya8gRkg0TzcS/uvGse8bwk oknuLrbHk4wZs6jRGyVd38y7HUbq0zIpMit/lLaE/WRAPDyasMaxGe5jWOA002am8O WSQXfLUT/9fjwMv79dFuQdL/acTJ+fYN9w7PROeM= Received: from skolluku-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: skolluku@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9405661406; Tue, 21 Aug 2018 12:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1534854272; bh=sQFyqJppBwlKkKU3YCsz8jiM5bcFhPOIs6iV/641l4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bfk6KvyzxmSvAZg9BhUerbjOjLZAP5KTZV/jSs60UYBzxZXO00WxrzzC5S2KhzO/I e8Ep77KAEBShDb0QODhTK7iZqK0QSg7YRmWKSjKbIiDuqgJt8QfuG8X4D5g7CVlFmJ 3av41BG+sdXuoWv9jVNMiIIBbyu0snBhDEUj8+3I= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9405661406 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=skolluku@codeaurora.org From: Sravanthi Kollukuduru To: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org Cc: Sravanthi Kollukuduru , robdclark@gmail.com, seanpaul@chromium.org, sean@poorly.run Subject: [PATCH 2/2] drm/msm/dpu: fix for cursor blend issue Date: Tue, 21 Aug 2018 17:54:10 +0530 Message-Id: <20180821122410.17280-3-skolluku@codeaurora.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20180821122410.17280-1-skolluku@codeaurora.org> References: <20180821122410.17280-1-skolluku@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current driver has the opaque blend mode set as the default causing the black box effect around the cursor. The fix enables choosing a different blend mode for alpha enabled formats. Signed-off-by: Sravanthi Kollukuduru --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 0cd9456a6c4c..fc6200c74614 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -297,14 +297,29 @@ static void dpu_crtc_destroy(struct drm_crtc *crtc) } static void _dpu_crtc_setup_blend_cfg(struct dpu_crtc_mixer *mixer, - struct dpu_plane_state *pstate) + struct dpu_plane_state *pstate, struct dpu_format *format) { struct dpu_hw_mixer *lm = mixer->hw_lm; + uint32_t blend_op; /* default to opaque blending */ - lm->ops.setup_blend_config(lm, pstate->stage, 0XFF, 0, - DPU_BLEND_FG_ALPHA_FG_CONST | - DPU_BLEND_BG_ALPHA_BG_CONST); + blend_op = DPU_BLEND_FG_ALPHA_FG_CONST | + DPU_BLEND_BG_ALPHA_BG_CONST; + + if (format->alpha_enable) { + /* coverage blending */ + blend_op = DPU_BLEND_FG_ALPHA_FG_PIXEL | + DPU_BLEND_BG_ALPHA_FG_PIXEL | + DPU_BLEND_BG_INV_ALPHA; + } + + lm->ops.setup_blend_config(lm, pstate->stage, + 0xFF, 0, blend_op); + + DPU_DEBUG( + "format:%4.4s, alpha_en(%u) blend_op:0x%x\n", + (char *) &format->base.pixel_format, + format->alpha_enable, blend_op); } static void _dpu_crtc_program_lm_output_roi(struct drm_crtc *crtc) @@ -401,7 +416,8 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc, /* blend config update */ for (lm_idx = 0; lm_idx < dpu_crtc->num_mixers; lm_idx++) { - _dpu_crtc_setup_blend_cfg(mixer + lm_idx, pstate); + _dpu_crtc_setup_blend_cfg(mixer + lm_idx, + pstate, format); mixer[lm_idx].flush_mask |= flush_mask;