From patchwork Thu Sep 10 17:18:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 11770103 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 0C329112E for ; Fri, 11 Sep 2020 09:50:22 +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 D4243206F4 for ; Fri, 11 Sep 2020 09:50:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gNcWA/DM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4243206F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 4AA576E9AC; Fri, 11 Sep 2020 09:49:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5CF9C89DFD for ; Thu, 10 Sep 2020 17:18:48 +0000 (UTC) Received: by mail-qk1-x743.google.com with SMTP id w16so6848874qkj.7 for ; Thu, 10 Sep 2020 10:18:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KOPXfJ4o+30xKb8orSC8RLivwhkM6sb3eQ91eOmY0Vo=; b=gNcWA/DM9IKpsqtMRdGgyqQBa8ngfSU0q04kaiB/amfRI5odcxESYG9avLfaext3aR MTBhV7S0tIkeb6rvVo/oM4QNgeAnZobe2glDYt3akPElqv7scj9/BCIuGRH8BOwLKgHC 8T7CvZ3siJpvaw1VkA9fqbjVSW5pMMp03K2VOVLo344lOlhMt+OwM3PKI5+zMDyQj14Z bIf0x2ixTqcKpb+zjZPuNYb3mhvU/fYE8w0QWQ2XvytuC4yuU0KeDHHKz6nsOBLyWQiY xIvGAS3BHP9rpF6YcHRcpDs3TuLpEYX8sQN4TzTLBWQ8xqTvLYevBPB9zqAYKqgDCbWm uSig== 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:mime-version :content-transfer-encoding; bh=KOPXfJ4o+30xKb8orSC8RLivwhkM6sb3eQ91eOmY0Vo=; b=Z7/UVVPFDZnqT1bl7t6mwLqazDYVcwwEBoIInD59oYi8c/DkWgNhxK069XkMGDaWFh 2ES/bvFXxDuOj8Sp1K4rlLhL1YUH0448FaBHRmi5++p+WKNQSJ+E6or3XOvWoFeyJHEU PYAoyIV3Cj7ft+3cmSUs3rrNVUhaLEmUBQ9I2FKnc8QfJXMbBnaMIQRgv1Wid6LkeC2R vqD66ZaKpS43EuI13CYV6jWS4BydICmyq28CNLzERSeVuLBVM7ZEj53L5Tx5RbmvMDEt Z2tawR/EUNLdvJTzE21Sfh5D513r+HBRwquhalbrYYd/BRxSuUaq2XVWirM962sx8KiV ffkg== X-Gm-Message-State: AOAM530KGir8WL68qgLizTJ13wDmK4ntLfQXD+Y/5l9oTJIZLhYqoHAo HwGV5fH2025YcG2MVPZ9C7o= X-Google-Smtp-Source: ABdhPJxwB25vHPpgRsVbfVcHXlqygPLmZlVsqyZuhSN4fHMZ/F6hTxWL8F5aoBE4JZF8QQlHp/ZDzw== X-Received: by 2002:a37:b347:: with SMTP id c68mr8956861qkf.430.1599758327484; Thu, 10 Sep 2020 10:18:47 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:45d1:2600::1]) by smtp.gmail.com with ESMTPSA id a25sm7370452qtd.8.2020.09.10.10.18.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 10:18:46 -0700 (PDT) From: Nathan Chancellor To: Eric Anholt , Maxime Ripard Subject: [PATCH] drm/vc4: Fix bitwise OR versus ternary operator in vc4_plane_mode_set Date: Thu, 10 Sep 2020 10:18:32 -0700 Message-Id: <20200910171831.4112580-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Patchwork-Bot: notify X-Mailman-Approved-At: Fri, 11 Sep 2020 09:49:36 +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: clang-built-linux@googlegroups.com, Nathan Chancellor , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Dave Stevenson Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Clang warns: drivers/gpu/drm/vc4/vc4_plane.c:901:27: warning: operator '?:' has lower precedence than '|'; '|' will be evaluated first [-Wbitwise-conditional-parentheses] fb->format->has_alpha ? ~~~~~~~~~~~~~~~~~~~~~ ^ drivers/gpu/drm/vc4/vc4_plane.c:901:27: note: place parentheses around the '|' expression to silence this warning fb->format->has_alpha ? ~~~~~~~~~~~~~~~~~~~~~ ^ drivers/gpu/drm/vc4/vc4_plane.c:901:27: note: place parentheses around the '?:' expression to evaluate it first fb->format->has_alpha ? ~~~~~~~~~~~~~~~~~~~~~~^ 1 warning generated. Add the parentheses as that was clearly intended, otherwise SCALER5_CTL2_ALPHA_PREMULT won't be added to the list. Fixes: c54619b0bfb3 ("drm/vc4: Add support for the BCM2711 HVS5") Link: https://github.com/ClangBuiltLinux/linux/issues/1150 Signed-off-by: Nathan Chancellor --- drivers/gpu/drm/vc4/vc4_plane.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: 8c3c818c23a5bbce6ff180dd2ee04415241df77c diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 24d7e6db6fdd..89543fa8ca4d 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -898,8 +898,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane, vc4_dlist_write(vc4_state, VC4_SET_FIELD(state->alpha >> 4, SCALER5_CTL2_ALPHA) | - fb->format->has_alpha ? - SCALER5_CTL2_ALPHA_PREMULT : 0 | + (fb->format->has_alpha ? + SCALER5_CTL2_ALPHA_PREMULT : 0) | (mix_plane_alpha ? SCALER5_CTL2_ALPHA_MIX : 0) | VC4_SET_FIELD(fb->format->has_alpha ?