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 X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E631AC64E8A for ; Mon, 30 Nov 2020 14:36:57 +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 67D5620684 for ; Mon, 30 Nov 2020 14:36:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ti.com header.i=@ti.com header.b="sgLBE7fW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 67D5620684 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.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 BDD106E4F1; Mon, 30 Nov 2020 14:36:56 +0000 (UTC) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2FD1E6E4F1 for ; Mon, 30 Nov 2020 14:36:55 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0AUEakL0008923; Mon, 30 Nov 2020 08:36:46 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1606747006; bh=7DBeTod5EdnnhhKfHPbhvDPCVBSBhP6TblzvWLrEH8Y=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=sgLBE7fWkLsM+yIORLx+XxlgFTvFAdc6rXa/wp7HABxyQTeuvwLuzY1b32+FLUKpV vkIew80D7w77V1RBFY9PI1pB1BRogoDejNzJb8IsvMswLD9KBPMmRoUR90T7bUXAWq sdkjFdP+3hk8FV3udCfyjTRLXqaZzkLnZHkAsMSY= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0AUEak7g050146 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 30 Nov 2020 08:36:46 -0600 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 30 Nov 2020 08:36:46 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Mon, 30 Nov 2020 08:36:46 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0AUEaiDM062125; Mon, 30 Nov 2020 08:36:44 -0600 Subject: Re: [PATCH v2 5/5] drm/omap: Enable COLOR_ENCODING and COLOR_RANGE properties for planes To: Laurent Pinchart References: <20201103080310.164453-1-tomi.valkeinen@ti.com> <20201103080310.164453-6-tomi.valkeinen@ti.com> <20201130105038.GU4141@pendragon.ideasonboard.com> <762454cd-56e5-bcb7-cef0-f4fa3833591f@ti.com> <20201130141917.GA13082@pendragon.ideasonboard.com> From: Tomi Valkeinen Message-ID: <554852e9-46ca-38dd-4ec9-d405d341b5cb@ti.com> Date: Mon, 30 Nov 2020 16:36:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201130141917.GA13082@pendragon.ideasonboard.com> Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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: Pekka Paalanen , Daniel Vetter , dri-devel@lists.freedesktop.org, Sekhar Nori , Jyri Sarha , Nikhil Devshatwar Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 30/11/2020 16:19, Laurent Pinchart wrote: >>>> + switch (color_encoding) { >>>> + case DRM_COLOR_YCBCR_BT601: >>>> + if (color_range == DRM_COLOR_YCBCR_FULL_RANGE) >>>> + csc = &coefs_yuv2rgb_bt601_full; >>>> + else >>>> + csc = &coefs_yuv2rgb_bt601_lim; >>>> + break; >>>> + case DRM_COLOR_YCBCR_BT709: >>>> + if (color_range == DRM_COLOR_YCBCR_FULL_RANGE) >>>> + csc = &coefs_yuv2rgb_bt709_full; >>>> + else >>>> + csc = &coefs_yuv2rgb_bt709_lim; >>>> + break; >>>> + default: >>>> + DSSERR("Unsupported CSC mode %d for plane %d\n", >>>> + color_encoding, plane); >>>> + return -EINVAL; >>> >>> Can this happen, given that the properties are created with only the >>> above four combinations being allowed ? >> >> No, it shouldn't happen. Are you just asking, or are you suggesting that we shouldn't check if >> color_encoding is valid here? >> >> I don't usually check parameters which we can expect to be correct, but with we use switch/if with >> the parameter, we have to deal with the "else" case too. > > I use a default in that case, especially if it can avoid turning the > function from void to int. Yes, that's true. I'll do the change. Tomi -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel