From mboxrd@z Thu Jan 1 00:00:00 1970 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 43A47C433EF for ; Mon, 7 Feb 2022 10:07:38 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I80wQVxlCCQ1xrzrnIkPUfbz0Me0IiB+iJ1un+4txHc=; b=dH0dIp6ioiWIT/ C7D0o8Fg2+/BiWW+vY9R67Ms7N5pvEuHpVG6P31/08OMA/a/gZIw5nqa9DuBnXM+cSdyGVxz35RqX +jSW0NObKqPz2+wN1wSM0J0HyyCY5kfm6S5nby6RibbH+vVEheeKmfw0yXhkaLe1hPdzZtZjLhIXQ X4Kg9RUBl9ByQxY/uzLKvls3B+uS9MxHtP7xSBehA4F82F+51CNhZathbKtmoVGTUcWnB9PohlPQI 6eHWMgW4yn7p0IlOUcwzm8/6GH6aY0hz0oMF4X4W5P0RktjzHW0kkyZrY5YDRDcf+VkldgVcCCrY8 wu+1QclvsEZyHFX6D4sQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nH0uB-009kV0-Q7; Mon, 07 Feb 2022 10:05:57 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nH0pK-009iq3-1m for linux-arm-kernel@lists.infradead.org; Mon, 07 Feb 2022 10:00:55 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 2179CZSj016591; Mon, 7 Feb 2022 11:00:37 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=veZo0P/JfQdRJDIli6sGt4ZGDkxpZF8WrXm4WgcbFDs=; b=LyOM7OE32aQxV9zw7duuPrfrJldOPTSzvtdbO7khQHp6VH6nsQS/1nDO1hXbZLmJq3nw 7PsdcbDW2DruY7hmskH5TenmUVY9yx7uJ5i1DaUsAgLg+HOCJUkGv7VGwAMsVAtu4F96 sCJ/nB5vp27U2qF3aQGMcKiyNcnqc+aDARpliHA9q4KtKmWvBpM2371vS0moSutXQlXv JD7nJX3nfnuqtwSrLyWpVfNb7yZ7m865ES71jT5FzTN6K3vYc11iMh0Vob87hfDscjJB 3OMPkL/dsoItJkdZBEb9HLlQ9rzsqz2u0jZF322OtUadHKol830UF6t/NX5nkfrXyXfN /w== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3e30kg08hy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 07 Feb 2022 11:00:37 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5343C10002A; Mon, 7 Feb 2022 11:00:35 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 3EFD9212FC5; Mon, 7 Feb 2022 11:00:35 +0100 (CET) Received: from [10.129.7.146] (10.75.127.49) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Mon, 7 Feb 2022 11:00:34 +0100 Message-ID: <7bd0a0a9-4015-b54c-f745-f813496be61b@foss.st.com> Date: Mon, 7 Feb 2022 11:00:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH 5/5] drm/stm: ltdc: add support of ycbcr pixel formats Content-Language: en-US To: Nathan Chancellor CC: Philippe Cornu , Raphael Gallais-Pou , David Airlie , Daniel Vetter , Maxime Coquelin , Alexandre Torgue , , , , References: <20211215214843.20703-1-yannick.fertre@foss.st.com> From: yannick Fertre In-Reply-To: X-Originating-IP: [10.75.127.49] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-07_03,2022-02-07_01,2021-12-02_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220207_020054_433342_8BD92941 X-CRM114-Status: GOOD ( 24.30 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Nathan, On 2/2/22 17:54, Nathan Chancellor wrote: > Hi Yannick, > > On Wed, Dec 15, 2021 at 10:48:43PM +0100, Yannick Fertre wrote: >> This patch adds the following YCbCr input pixel formats on the latest >> LTDC hardware version: >> >> 1 plane (co-planar) : YUYV, YVYU, UYVY, VYUY >> 2 planes (semi-planar): NV12, NV21 >> 3 planes (full-planar): YU12=I420=DRM YUV420, YV12=DRM YVU420 >> >> Signed-off-by: Yannick Fertre > > > >> +static inline void ltdc_set_ycbcr_config(struct drm_plane *plane, u32 drm_pix_fmt) >> +{ >> + struct ltdc_device *ldev = plane_to_ltdc(plane); >> + struct drm_plane_state *state = plane->state; >> + u32 lofs = plane->index * LAY_OFS; >> + u32 val; >> + >> + switch (drm_pix_fmt) { >> + case DRM_FORMAT_YUYV: >> + val = (YCM_I << 4) | LxPCR_YF | LxPCR_CBF; >> + break; >> + case DRM_FORMAT_YVYU: >> + val = (YCM_I << 4) | LxPCR_YF; >> + break; >> + case DRM_FORMAT_UYVY: >> + val = (YCM_I << 4) | LxPCR_CBF; >> + break; >> + case DRM_FORMAT_VYUY: >> + val = (YCM_I << 4); >> + break; >> + case DRM_FORMAT_NV12: >> + val = (YCM_SP << 4) | LxPCR_CBF; >> + break; >> + case DRM_FORMAT_NV21: >> + val = (YCM_SP << 4); >> + break; >> + case DRM_FORMAT_YUV420: >> + case DRM_FORMAT_YVU420: >> + val = (YCM_FP << 4); >> + break; >> + default: >> + /* RGB or not a YCbCr supported format */ >> + break; >> + } >> + >> + /* Enable limited range */ >> + if (state->color_range == DRM_COLOR_YCBCR_LIMITED_RANGE) >> + val |= LxPCR_YREN; >> + >> + /* enable ycbcr conversion */ >> + val |= LxPCR_YCEN; >> + >> + regmap_write(ldev->regmap, LTDC_L1PCR + lofs, val); >> +} > > This patch as commit 484e72d3146b ("drm/stm: ltdc: add support of ycbcr > pixel formats") in -next introduced the following clang warning: > > drivers/gpu/drm/stm/ltdc.c:625:2: warning: variable 'val' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] > default: > ^~~~~~~ > drivers/gpu/drm/stm/ltdc.c:635:2: note: uninitialized use occurs here > val |= LxPCR_YCEN; > ^~~ > drivers/gpu/drm/stm/ltdc.c:600:9: note: initialize the variable 'val' to silence this warning > u32 val; > ^ > = 0 > 1 warning generated. > > Would it be okay to just return in the default case (maybe with a > message about an unsupported format?) or should there be another fix? > > Cheers, Thanks for your help. It'okay for a message for unsupported format with a return in the default case. Do you want create & push the patch? Best regards _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel