From patchwork Mon Oct 31 17:16:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 13026150 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45787ECAAA1 for ; Mon, 31 Oct 2022 17:17:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fd1Q7b3TDxRURV07cYkvmLBxSsTczFTgre+1GTOcCNE=; b=lplIDjaXyrttfW NfEDPsMIenLlRHW2q0M8k/khLxhRUAGphrv5cPCEIRGUSajbaNOiN2x80P1OekvZdyet8cDEx/o2y 9F5qFliL0xsBi/Q20MnpHnu4eNSmaaq2ugv57qXa1alXeifSS4XU3Fr4zCACVWUijtaNeIgPoI1u5 hgAR/UlageeeZa/tpLmlbpaGQsxg8vF3Bj3S9MjzgEwzzSrnpKkM1V6ZU51R0MH53Chra88W4ibmU sEZwne8BkghghrCcO/ph21oJSQlAWw8EzO7CN2dBVwndtTiJTRnGIObL3heuLS0j+YdJwReTVpysn LgLnYW270ZirL9cX8H9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opYOV-00DGOo-5x; Mon, 31 Oct 2022 17:16:15 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1opYOS-00DGKs-Ht for linux-arm-kernel@lists.infradead.org; Mon, 31 Oct 2022 17:16:13 +0000 Received: by mail-pg1-x535.google.com with SMTP id r18so11220523pgr.12 for ; Mon, 31 Oct 2022 10:16:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ew7SqTPEFFhxu7/hKrNbrME/m/ofSkUv4YYTUxK9hTE=; b=LNy0wlk54NXx0XGRLGJLTGHN4ywvxf5ommsqE1Fdvkb3oQxH48emeDOhk5HgzYYP5i D6Idhh6Iw5QX1O0N/ayHK9u2K512PuftFkYPlMpLOP7ZAjKaGvggrvDwGBhXal3Q86yb 19ek7qCAUe4SKIA9ct7LeonTh+0TQdvtmnfXY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ew7SqTPEFFhxu7/hKrNbrME/m/ofSkUv4YYTUxK9hTE=; b=AqC9X67TNubQMvd0/Z1Eym0SBtWuiMR1aOR1S5AreJA+6XcXcBr9SoJQzBOJ16FwSG K8AeF5RiUjWadiwvBVSmaJWwaSn199c2clrElFRuKFEXVF2l9N30m+gVdEaGZqyVbn+X 908VoREBxZMkKNP5mx/pStUarBSnmAsbd/LUZb+X0OT8soUY2GV61ILdqju0BWFoYDCB nUFvyWaM0dLZbO5CqVVA9rQ55BthGWq8w8qsBLxTYJ7U8+92Mq7UDB1TYdkliaRY6o4e /3ZdPhnTzHFgVyFU7lY49pXSmWOzH7HAeSpZz5cLz0VwdrO6+oX/uPuTdHmJZtkFlRSN xh1w== X-Gm-Message-State: ACrzQf1s+F4jUQN+/eVjJQ+zthmbigFHFaKaSz4qNPOmka+OHrl2kose sZXQuyYiHMnEwK+SbKJrQUQcAw== X-Google-Smtp-Source: AMsMyM4cDfw2gQpzV2vuUo36o86Uf/NDWo6Qa/wbI4r1jWqZL9p4/hZK2btJIj/1sXglXJX0VgmwHw== X-Received: by 2002:a63:69c2:0:b0:46a:eeb1:e784 with SMTP id e185-20020a6369c2000000b0046aeeb1e784mr13351654pgc.589.1667236569518; Mon, 31 Oct 2022 10:16:09 -0700 (PDT) Received: from localhost ([2620:15c:9d:2:cf9d:6561:637d:2194]) by smtp.gmail.com with UTF8SMTPSA id f15-20020a170902684f00b0017d97d13b18sm4679040pln.65.2022.10.31.10.16.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Oct 2022 10:16:09 -0700 (PDT) From: Brian Norris To: =?utf-8?q?Heiko_St=C3=BCbner?= Cc: Sandy Huang , linux-arm-kernel@lists.infradead.org, Andrzej Pietrasiewicz , linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Brian Norris Subject: [PATCH] drm/rockchip: vop: Quiet always-warning AFBC log Date: Mon, 31 Oct 2022 10:16:01 -0700 Message-Id: <20221031101557.1.Ic1569d394173c1c3016142fee4bb87a09753db94@changeid> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221031_101612_595752_9134D31B X-CRM114-Status: GOOD ( 14.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The downstream code from which this was derived didn't ever run through this 'switch' block with non-AFBC formats, but the upstream code does -- we use this function to probe whether a given format is supported. Demote the warning to eliminate this sort of warning seen on every boot: [drm] unsupported AFBC format[3231564e] And make it warn more than once, because if we *actually* care to see what formats we're probing/rejecting and for what reasons, we probably care about more than just the first message. Drop the comment, because one of the two *is* commonly reachable. And lastly, drop the unreachable return; we'd do better to let the compiler complain if we start hitting this unexpectedly. Signed-off-by: Brian Norris --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index fa1f4ee6d195..aab77eb6caa3 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -316,13 +316,10 @@ static int vop_convert_afbc_format(uint32_t format) case DRM_FORMAT_RGB565: case DRM_FORMAT_BGR565: return AFBC_FMT_RGB565; - /* either of the below should not be reachable */ default: - DRM_WARN_ONCE("unsupported AFBC format[%08x]\n", format); + DRM_DEBUG_KMS("unsupported AFBC format[%08x]\n", format); return -EINVAL; } - - return -EINVAL; } static uint16_t scl_vop_cal_scale(enum scale_mode mode, uint32_t src,