From patchwork Wed Dec 5 16:29:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10714571 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 BF7E314E2 for ; Wed, 5 Dec 2018 16:30:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF7552D027 for ; Wed, 5 Dec 2018 16:30:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADAB22DC9E; Wed, 5 Dec 2018 16:30:14 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 2FF532DCAC for ; Wed, 5 Dec 2018 16:30:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727436AbeLEQaN (ORCPT ); Wed, 5 Dec 2018 11:30:13 -0500 Received: from mail-yb1-f196.google.com ([209.85.219.196]:36096 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727429AbeLEQaN (ORCPT ); Wed, 5 Dec 2018 11:30:13 -0500 Received: by mail-yb1-f196.google.com with SMTP id w203so4811221ybg.3 for ; Wed, 05 Dec 2018 08:30:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ctkl0GTGA80LHhrezbVlODyEHhudGv5yalbggZE0d84=; b=Wp1zzp81p1bbM4nxdaBQRPtS2/E7MfmVKSbVMdWu4LkhQ1zoywjQWklPJVb5Ad9Z+6 A3CMmHuT80wR1wuUZJB/dszqSCSauQneqgzPUx4J6PuUs1GnN18CLoBDM+hmTTPuipwz FSyyzKQPaFPx0ccLW2F2Q0u+LL3qa4jUFrZvyEmGmF6400U244V70/Q0X+LJf6Il6iv5 YvmhgF57uUmX85sYYgMhyBWAY/OdujdVFNsQZJUQZ+RdNqDI7mSRSC9CNXYtVx4fG2OJ 7AalsMjalCs6Fw9UMrzdEwyrANXjBGXna56spq6SFvwFWZ5xyxgSXxHdBGn8dn2FVfZa AfuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ctkl0GTGA80LHhrezbVlODyEHhudGv5yalbggZE0d84=; b=om1ERYHZ0PnbaEHicKz/TuJgbIaRuXWLl4cdfc4YeIQOtjd8vuY7y+rPSK7LoT4fRO SiuUPsDtspSyAPZrjRMuPcvF3cuJOjEMIhEFuabmxWAMTb8ZZsLofq4RhT1zL0L8jqOP 38+2Bwyl8OQMECkGj6LS+uuVksUtVopaj8my2RtWpIl8iyZHiQ5iZxDl6dC+ZUGhV17M BIv/ARJfjN4RqLQRCZiEfTMhsxHgIJ6qMKznR3MHQcUk5FZCDpWuYqAWXD70SnThelE/ fhi8WAYeMzXUTGArjv2IdHAUUAFXfQt8NOjckppZRlzT02eUlm40Vs/4Wgv2bdikbSi1 vKfw== X-Gm-Message-State: AA+aEWbeCEl8ygJrIrgmcyrKeJHhOL9W52FN8vZNq20uL+0olibMonb5 B+O8Cy5mzfFLinmerG/vmLhqFg== X-Google-Smtp-Source: AFSGD/V0SO0NhmNmRKRWBkGI8G9bWKVh/Ig/zorO4B8gt/UNAwcy5tS5XRNfz6byx3j8qJ+ZVwGhUA== X-Received: by 2002:a25:1986:: with SMTP id 128-v6mr24144629ybz.234.1544027412404; Wed, 05 Dec 2018 08:30:12 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id n133sm6460470ywb.55.2018.12.05.08.30.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 08:30:12 -0800 (PST) From: Sean Paul Cc: robdclark@gmail.com, jsanka@codeaurora.org, Sean Paul , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 7/9] drm/msm: mdp5: Remove alpha from plane state Date: Wed, 5 Dec 2018 11:29:39 -0500 Message-Id: <20181205162958.25025-7-sean@poorly.run> X-Mailer: git-send-email 2.20.0.rc1.387.gf8505762e3-goog In-Reply-To: <20181205162958.25025-1-sean@poorly.run> References: <20181205162958.25025-1-sean@poorly.run> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) 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 From: Sean Paul It's always 0xFF, so remove it and any code that relies on it being != 0xFF. Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 27 ++++++---------------- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h | 1 - drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 4 ---- drivers/gpu/drm/msm/msm_drv.h | 1 - 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index 035be33405f08..bfa97ec063965 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -230,7 +230,7 @@ static void blend_setup(struct drm_crtc *crtc) struct mdp5_hw_mixer *r_mixer = pipeline->r_mixer; uint32_t r_lm = r_mixer ? r_mixer->lm : 0; struct mdp5_ctl *ctl = mdp5_cstate->ctl; - uint32_t blend_op, fg_alpha, bg_alpha, ctl_blend_flags = 0; + uint32_t blend_op, ctl_blend_flags = 0; unsigned long flags; enum mdp5_pipe stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { { SSPP_NONE } }; enum mdp5_pipe r_stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { { SSPP_NONE } }; @@ -300,44 +300,31 @@ static void blend_setup(struct drm_crtc *crtc) plane = pstates[i]->base.plane; blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_CONST) | MDP5_LM_BLEND_OP_MODE_BG_ALPHA(BG_CONST); - fg_alpha = pstates[i]->alpha; - bg_alpha = 0xFF - pstates[i]->alpha; if (!format->alpha_enable && bg_alpha_enabled) mixer_op_mode = 0; else mixer_op_mode |= mdp5_lm_use_fg_alpha_mask(i); - DBG("Stage %d fg_alpha %x bg_alpha %x", i, fg_alpha, bg_alpha); - if (format->alpha_enable) { blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_PIXEL) | - MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL); - if (fg_alpha != 0xff) { - bg_alpha = fg_alpha; - blend_op |= - MDP5_LM_BLEND_OP_MODE_FG_MOD_ALPHA | - MDP5_LM_BLEND_OP_MODE_FG_INV_MOD_ALPHA | - MDP5_LM_BLEND_OP_MODE_BG_MOD_ALPHA | - MDP5_LM_BLEND_OP_MODE_BG_INV_MOD_ALPHA; - } else { - blend_op |= MDP5_LM_BLEND_OP_MODE_BG_INV_ALPHA; - } + MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL) | + MDP5_LM_BLEND_OP_MODE_BG_INV_ALPHA; } mdp5_write(mdp5_kms, REG_MDP5_LM_BLEND_OP_MODE(lm, blender(i)), blend_op); mdp5_write(mdp5_kms, REG_MDP5_LM_BLEND_FG_ALPHA(lm, - blender(i)), fg_alpha); + blender(i)), 0xFF); mdp5_write(mdp5_kms, REG_MDP5_LM_BLEND_BG_ALPHA(lm, - blender(i)), bg_alpha); + blender(i)), 0); if (r_mixer) { mdp5_write(mdp5_kms, REG_MDP5_LM_BLEND_OP_MODE(r_lm, blender(i)), blend_op); mdp5_write(mdp5_kms, REG_MDP5_LM_BLEND_FG_ALPHA(r_lm, - blender(i)), fg_alpha); + blender(i)), 0xFF); mdp5_write(mdp5_kms, REG_MDP5_LM_BLEND_BG_ALPHA(r_lm, - blender(i)), bg_alpha); + blender(i)), 0); } } diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h index 61b3331dcab9c..8605a7dee44c1 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h @@ -109,7 +109,6 @@ struct mdp5_plane_state { /* aligned with property */ uint8_t zpos; - uint8_t alpha; /* assigned by crtc blender */ enum mdp_mixer_stage_id stage; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index e96aff8e55757..5ea06804cef2b 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -175,7 +175,6 @@ mdp5_plane_atomic_print_state(struct drm_printer *p, pstate->r_hwpipe ? pstate->r_hwpipe->name : "(null)"); drm_printf(p, "\tzpos=%u\n", pstate->zpos); - drm_printf(p, "\talpha=%u\n", pstate->alpha); drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage)); } @@ -189,9 +188,6 @@ static void mdp5_plane_reset(struct drm_plane *plane) kfree(to_mdp5_plane_state(plane->state)); mdp5_state = kzalloc(sizeof(*mdp5_state), GFP_KERNEL); - /* assign default blend parameters */ - mdp5_state->alpha = 255; - if (plane->type == DRM_PLANE_TYPE_PRIMARY) mdp5_state->zpos = STAGE_BASE; else diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index b6aa04511ded9..a578bad540130 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -72,7 +72,6 @@ struct msm_file_private { enum msm_mdp_plane_property { PLANE_PROP_ZPOS, - PLANE_PROP_ALPHA, PLANE_PROP_MAX_NUM };