From patchwork Tue May 25 13:13:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 447182 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp4258554jac; Tue, 25 May 2021 06:13:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoDvQ6NC8R33dtiNLHasipBUtsCrLNsdRTYpQ0g2Hu0m+Po+nTt3eRDKaEkpYlIhOJkzez X-Received: by 2002:a17:907:1c0f:: with SMTP id nc15mr29484930ejc.27.1621948405757; Tue, 25 May 2021 06:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621948405; cv=none; d=google.com; s=arc-20160816; b=IGVHWaIP/h9Z1HbmisYTB+npkAk8+CaVm3nvlKgmwQGAULePMHi197AIJP5pyuVkiw admnAjselnwdVnUmSNm363rhq51iJQdxUg4/WDcEsCK9J9Cn32duIaAx8wK9OWwx+vdo Y500KOiuFR3KB2UTRS2G8GV36t3pzxNEY33UeNIEL3XGC1rqWBXszHeUayrUzHXirWjT nEAdlsC8U8dIWwwld5fTnUqnTQd5n0Bymt5R7VkOsJgvDU+qVb6Obcbt9ENuO+D8ce1A yr+1ysMfagx045gZ7KzbOWbUrF7wko/Tv2sxkF3E5HBferh/+XhWJVIMA1NvmWxdp1V7 a5og== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gpuqQrkSszYjpRL6dWUYSBVUoBVLpy578W8ZqjiamV8=; b=tl+VeC0sTqv3pvKRRvbQUlf4qW6bWC5VUDq1BWa8Qs4pWO/Bm4tcfiR/4NcdjYdZUH g7a4M1CTDDaQ9Io+yUgraKCt9dbHURcKQTsS6L7r2xyLnR1wZhCCxByQVLGZ5yiM95FR PgYIIeF5wG0QPMCS+2QtydDRYeBt1kkKKkN5nH3YwbYKSoIzYzCv92qJWofB+VpaCtkS b7fkvgJUgv6NQlQhQ2/cJjjWmGJ3ruUoE8yRErEW4+GYMyc3dZEEdEgUfhcYI98wCeml EefBaRh4eKkpQT07uWr02hvlH7dF7Yb8+Ulfo5mik63pINNeUXQVJSGCc+5x+b7Stu1F 4IKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TGTDA0LY; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hh4si15556805ejb.79.2021.05.25.06.13.25; Tue, 25 May 2021 06:13:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TGTDA0LY; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233147AbhEYNOx (ORCPT + 17 others); Tue, 25 May 2021 09:14:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233148AbhEYNOw (ORCPT ); Tue, 25 May 2021 09:14:52 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58EA6C061574 for ; Tue, 25 May 2021 06:13:22 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id e2so31727301ljk.4 for ; Tue, 25 May 2021 06:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gpuqQrkSszYjpRL6dWUYSBVUoBVLpy578W8ZqjiamV8=; b=TGTDA0LY6Rac9WrS1gx9qGXob8SCe4/HQn3VIWjT7j3etrTQR28E4ckeXbh9yFwIrT uDLR9OvvL1JEQQfKlAd0QD9g1dV1N3oqRg6vfJJiyzdk/ntW2JnJ6RwpDBXZqLdPCMGP Cf1schqs1AaxJJ+1CUd1So/GwaYqV4VuAwjBdDAbazMlMNYFXBPqXoG49ZYI3XoNxlbu SFw1SornWFEOW76OxnOK+Relb6GWPeqvRIuNVGptgHUqLClVeq2Q+7Q/0p0f+heR+2hW 4Tkd4DDlPCBItQqr/eRae/SneOrdeZfQEXD4Fnc+XrTSsam4FWUDYxo1qeb5BFLcRznH 8bCQ== 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=gpuqQrkSszYjpRL6dWUYSBVUoBVLpy578W8ZqjiamV8=; b=chqW3W/BwDqNL5hD0rJsQjatuxqdw4uWvhWd+QjVqPMzAaWpw6q2gJ1KRaGfld5HgY Ty7mbMbRXJkJTT9XoqQXyZ56hyI8FlhCaf7WT0/NO39ENOYtoEP9SV5Cvy+ruudpDUI5 MCztOcPb1sJ9mblDX1TlSXdvTJeqJ6Y33KbtuFZ7jodq3pBeF3YgzN+vbWV1Cp5x2UcM uworfRiUjoGzBn5qlOK4vfS6ZkBXsMkQ0FrobCjMuA6sujMgioAimSDA4R3oW/a8R/CK qj3WZihuN+1EoZYhvibOoODlig0oRC6ZYVn0GlM7L9sf+yp1RABUlyvVgzxtRTCZI/ee x6dQ== X-Gm-Message-State: AOAM530Gc0jNfjdbGZCaMtH+fzqbD+50A/24GR9JF1Ws5RAgCFnGEojH b+WcPoT3g/XqkFOXZ9+/TyjVyg== X-Received: by 2002:a2e:a554:: with SMTP id e20mr20270267ljn.23.1621948400405; Tue, 25 May 2021 06:13:20 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id t20sm2101108lji.53.2021.05.25.06.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 06:13:20 -0700 (PDT) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Cc: Jonathan Marek , Stephen Boyd , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 3/7] drm/msm/mdp5: use drm_plane_state for pixel blend mode Date: Tue, 25 May 2021 16:13:12 +0300 Message-Id: <20210525131316.3117809-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210525131316.3117809-1-dmitry.baryshkov@linaro.org> References: <20210525131316.3117809-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Use drm_plane_state's 'pixel_blend_mode' field rather than using 'premultiplied' field to mdp5_plane_state. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 6 ++++-- drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h | 1 - drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 5 +---- 3 files changed, 5 insertions(+), 7 deletions(-) -- 2.30.2 diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index b98d5abafd1f..ed4d91420417 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -301,7 +301,8 @@ static void blend_setup(struct drm_crtc *crtc) DBG("Stage %d fg_alpha %x bg_alpha %x", i, fg_alpha, bg_alpha); - if (format->alpha_enable && pstates[i]->premultiplied) { + if (format->alpha_enable && + pstates[i]->base.pixel_blend_mode == DRM_MODE_BLEND_PREMULTI) { blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_CONST) | MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL); if (fg_alpha != 0xff) { @@ -312,7 +313,8 @@ static void blend_setup(struct drm_crtc *crtc) } else { blend_op |= MDP5_LM_BLEND_OP_MODE_BG_INV_ALPHA; } - } else if (format->alpha_enable) { + } else if (format->alpha_enable && + pstates[i]->base.pixel_blend_mode == DRM_MODE_BLEND_COVERAGE) { blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_PIXEL) | MDP5_LM_BLEND_OP_MODE_BG_ALPHA(FG_PIXEL); if (fg_alpha != 0xff) { diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h index d7e04e99fb4e..d124c9bcdc60 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.h @@ -99,7 +99,6 @@ struct mdp5_plane_state { struct mdp5_hw_pipe *r_hwpipe; /* right hwpipe */ /* aligned with property */ - uint8_t premultiplied; uint8_t zpos; /* assigned by crtc blender */ diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 0fd1d10352aa..90cd825df16b 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -166,7 +166,7 @@ mdp5_plane_atomic_print_state(struct drm_printer *p, drm_printf(p, "\tright-hwpipe=%s\n", pstate->r_hwpipe ? pstate->r_hwpipe->name : "(null)"); - drm_printf(p, "\tpremultiplied=%u\n", pstate->premultiplied); + drm_printf(p, "\tblend_mode=%u\n", pstate->base.pixel_blend_mode); drm_printf(p, "\tzpos=%u\n", pstate->zpos); drm_printf(p, "\talpha=%u\n", pstate->base.alpha); drm_printf(p, "\tstage=%s\n", stage2name(pstate->stage)); @@ -182,9 +182,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->premultiplied = 0; - if (plane->type == DRM_PLANE_TYPE_PRIMARY) mdp5_state->zpos = STAGE_BASE; else