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.0 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 A4E5AC64E8A for ; Wed, 2 Dec 2020 11:52:16 +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 1B1702086A for ; Wed, 2 Dec 2020 11:52:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B1702086A 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 32DB26EA18; Wed, 2 Dec 2020 11:52:15 +0000 (UTC) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1F2AD6EA18 for ; Wed, 2 Dec 2020 11:52:14 +0000 (UTC) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0B2Bq58K008754; Wed, 2 Dec 2020 05:52:05 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1606909925; bh=5LCAFrusraR24nb3XrGoOmt1D3yteLf6ottAwTKWWs4=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=qEEC5fctkXUoWdbp1e0sUEGqCodHQRG8qLOCMmWuzrezVrw2yJrhsMDT2bcdqywdM VW/GVDF7C1zzhfqxkCmHJkFMDzPjzUTAutQlU5iW8J5Akoz1Ip/WTH1yxhaHlN1fsx rYrK7LOOWNO2ahnLHjJ5hbd7M5d2wWcgTsvxULpA= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0B2Bq5D6022260 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 2 Dec 2020 05:52:05 -0600 Received: from DLEE101.ent.ti.com (157.170.170.31) 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; Wed, 2 Dec 2020 05:52:04 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE101.ent.ti.com (157.170.170.31) 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; Wed, 2 Dec 2020 05:52:04 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0B2Bq2OE127226; Wed, 2 Dec 2020 05:52:02 -0600 Subject: Re: [PATCH v2 1/5] drm: add legacy support for using degamma for gamma To: Daniel Vetter References: <20201103080310.164453-1-tomi.valkeinen@ti.com> <20201103080310.164453-2-tomi.valkeinen@ti.com> <20201130103840.GR4141@pendragon.ideasonboard.com> <20201130141057.GL401619@phenom.ffwll.local> From: Tomi Valkeinen Message-ID: <93e718be-01ff-fc5c-6497-f7afb2becb38@ti.com> Date: Wed, 2 Dec 2020 13:52:01 +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: <20201130141057.GL401619@phenom.ffwll.local> 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 , Laurent Pinchart 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:10, Daniel Vetter wrote: > The thing is, the legacy helpers should be able to pull off what userspace > needs to do when it's using atomic anyway. Hard-coding information in the > kernel means we have a gap here. Hence imo legacy helpers doing the right > thing in all reasonable cases is imo better. > > In many cases I think we should even go further, and ditch driver ability > to overwrite legacy helper hooks like this. I thought we'd need that > flexibility for legacy userspace being incompatible in awkward ways, but > wasn't ever really needed. Worse, many drivers forget to wire up the > compat hooks. > > tldr, imo right thing to do here: > - move legacy gamma function from helpers into core code > - call it unconditionally for all atomic drivers (if there's no legacy > drivers using the hook left then we can outright remove it) > - make sure it dtrt in all cases There are atomic drivers which have their custom gamma_set function. I guess they don't support atomic color mgmt, but do support (legacy) gamma. We could make the core code call the gamma legacy helper automatically for atomic drivers that don't have gamma_set defined but do have GAMMA_LUT or DEGAMMA_LUT. But the gamma_set function is called also in a few places from drm_fb_helper.c, so this code wouldn't be fully inside drm_color_mgmt.c. Or we could just change drm_atomic_helper_legacy_gamma_set() to do the right thing, depending on GAMMA_LUT & DEGAMMA_LUT existence. 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