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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 6F494C64E7B for ; Mon, 30 Nov 2020 14:11:05 +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 E0E842084C for ; Mon, 30 Nov 2020 14:11:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="UtLJfxjq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0E842084C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch 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 E85CF6E4A7; Mon, 30 Nov 2020 14:11:02 +0000 (UTC) Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA2FB6E4A7 for ; Mon, 30 Nov 2020 14:11:01 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id e25so6392102wme.0 for ; Mon, 30 Nov 2020 06:11:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9qRzbHDy4yWskW5QhEEgT8r3UGS/MDRB/4O/1y2Si4s=; b=UtLJfxjqf+Ge4zZY0fdlCAz4ebigmTu4Vvevg+LzZ6mwqyMKS96zpoVkuq4vyFJQwG iqXm6MuH8wKhbZ4xehMWdzcooTZxxQv+jc4x1ZAmcoQUt2kEE3P4YChJHLrqux9dGx1B NTaJHbNjgjuOPMlM4OfuHEZ53WILC3SdhKeuc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9qRzbHDy4yWskW5QhEEgT8r3UGS/MDRB/4O/1y2Si4s=; b=AKTgZ7Ra+AJr/80od0vFBj86JFV6um270dmW/04GI3CH/BJmvfP5ObX7/AOFqcbCFe W5dzFxqrm2KPRZIzpksKQGMVBLoD+BsTdb2yIVs6vi5bBUOzN/r4GQ5uYucC/wWQKPE8 vOL7oZS+SimPAst4OowlJhf6tLL/Kc51AqY7KjSV8gRP108x5wU0nxaYxLXwcL405blb gwU593xdGdwlgI9VRNGpopt7BRzD55hNoDR3SXt4bNxc32uA3CxEVPKCfUS7EcYKzqat ZPv2Hxp+ORKDdzLk5DhfOZ+Hv3wLVGeA/UWQs7KNnz4pSrwuDcjRKs+eXr/c/nQWPKJ7 2F/w== X-Gm-Message-State: AOAM530qBCAu5gHJ7H/XZk2eESHsOtnUGhbhcEp4fzF1SJ6WG8SRlDuj XAGXMiiPVM5n3AzRc9i1T/6KLg== X-Google-Smtp-Source: ABdhPJz3DNMzV6IOZGj/YzG8aOQV9C042jYhGfH/113iaAKJ2iK64z2bxDxbbG5AxAX4+9FaElMXAQ== X-Received: by 2002:a05:600c:2a4b:: with SMTP id x11mr23851282wme.165.1606745460348; Mon, 30 Nov 2020 06:11:00 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id e1sm5815268wma.17.2020.11.30.06.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2020 06:10:59 -0800 (PST) Date: Mon, 30 Nov 2020 15:10:57 +0100 From: Daniel Vetter To: Tomi Valkeinen Subject: Re: [PATCH v2 1/5] drm: add legacy support for using degamma for gamma Message-ID: <20201130141057.GL401619@phenom.ffwll.local> References: <20201103080310.164453-1-tomi.valkeinen@ti.com> <20201103080310.164453-2-tomi.valkeinen@ti.com> <20201130103840.GR4141@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.7.0-1-amd64 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 Mon, Nov 30, 2020 at 02:12:39PM +0200, Tomi Valkeinen wrote: > On 30/11/2020 12:38, Laurent Pinchart wrote: > > >> + * can be used when the driver exposes either only GAMMA_LUT or both GAMMA_LUT > >> + * and DEGAMMA_LUT. > >> + */ > >> +int drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc, > >> + u16 *red, u16 *green, u16 *blue, > >> + uint32_t size, > >> + struct drm_modeset_acquire_ctx *ctx) > >> +{ > >> + return legacy_gamma_degamma_set(crtc, red, green, blue, size, ctx, false); > >> +} > > > > I wonder, would it make sense to make this automatic by setting the > > degamma LUT when only the DEGAMMA_LUT property exists, and the gamma LUT > > otherwise ? Are there use cases for drm_atomic_helper_legacy_degamma_set > > for drivers that support both gamma and degamma ? > > Yes, I think drm_atomic_helper_legacy_gamma_set() could do that. > > But if you look at the second patch, the driver deals with crtc_state->degamma_lut. Having > .gamma_set = drm_atomic_helper_legacy_degamma_set makes it bit more explicit and clear what the > driver is doing. > > That said, documenting what drm_atomic_helper_legacy_gamma_set does if there's only degamma should > also be clear enough, so... I don't have strong feelings either way =). 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 Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel