From patchwork Tue Dec 8 13:57:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 11958643 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 7C273C433FE for ; Tue, 8 Dec 2020 13:58:41 +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 344E5206DB for ; Tue, 8 Dec 2020 13:58:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 344E5206DB 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 D0DC56E951; Tue, 8 Dec 2020 13:58:38 +0000 (UTC) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4C0B56E92D for ; Tue, 8 Dec 2020 13:58:36 +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 0B8DwHQ2096211; Tue, 8 Dec 2020 07:58:17 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1607435897; bh=8u7GBisZm/kOJ0SvJc36jjltDWkw3zWYYYX2arxLlyo=; h=From:To:CC:Subject:Date; b=IAVOpQ16bOAb/zf2wdQ9JfP6qmvCMEX2jAcl0gvDYknYAQN96nBxXxePdfROqbbR/ YH/s2szRMTWmK/AFMfFEVM+HGTTtPXPaQ/rHlVSw1yrZIebd7hTmRK9gsHKWLDF4oz r22AmdjXKSWT8IuzQfuh9nZWrcr7pdtV7wbf5HMU= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0B8DwHLE107969 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 8 Dec 2020 07:58:17 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Tue, 8 Dec 2020 07:58:16 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE100.ent.ti.com (10.64.6.21) 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; Tue, 8 Dec 2020 07:58:16 -0600 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0B8DwCrN051014; Tue, 8 Dec 2020 07:58:12 -0600 From: Tomi Valkeinen To: , Daniel Vetter , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Laurent Pinchart Subject: [PATCH v2 0/2] drm: fix and cleanup legacy gamma support Date: Tue, 8 Dec 2020 15:57:57 +0200 Message-ID: <20201208135759.451772-1-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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: Yannick Fertre , Philippe Cornu , David Airlie , Russell King , Sandy Huang , Paul Cercueil , Tomi Valkeinen , Thomas Zimmermann , Matthias Brugger , Vincent Abriou , Maxime Coquelin , Alexandre Torgue Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi, This is v2 of the series. The first patch fixes legacy gamma table for HW which have a degamma lut block before CTM block, but no gamma lut after the CTM. This will allow us to add CTM support to omapdrm, which only has "pre-gamma" i.e. de-gamma table. The second one cleans up the legacy gamma support a bit by handling legacy gamma for modern drivers in the drm core. Changes in v2: - Use bitfields for has_gamma_prop and has_degamma_prop - Drop use_degamma variable - Also fix gamma/degamma handling in setcmap_atomic, which I had missed earlier. - Fix comments that were still referring to drm_atomic_helper_legacy_gamma_set - Drop drm_atomic_helper_legacy_gamma_set use from intel_display.c which I had missed earlier. - Move the declaration of the new functions to drm_crtc_internal.h I didn't add Laurent's RBs as I felt the changes were too big to keep the RB. Ville has a WIP branch at git://github.com/vsyrjala/linux.git fb_helper_c8_lut_4 which does more extensive cleanups to the gamma handling. That work is slightly overlapping with this series, but afaics the concepts do not conflict as such (but the code changes do conflict). Tomi Tomi Valkeinen (2): drm: add legacy support for using degamma for gamma drm: automatic legacy gamma support .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 - .../gpu/drm/arm/display/komeda/komeda_crtc.c | 1 - drivers/gpu/drm/arm/malidp_crtc.c | 1 - drivers/gpu/drm/armada/armada_crtc.c | 1 - drivers/gpu/drm/ast/ast_mode.c | 1 - .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 1 - drivers/gpu/drm/drm_atomic_helper.c | 70 ---------- drivers/gpu/drm/drm_color_mgmt.c | 122 ++++++++++++++++-- drivers/gpu/drm/drm_crtc_internal.h | 6 + drivers/gpu/drm/drm_fb_helper.c | 21 +-- drivers/gpu/drm/i915/display/intel_display.c | 1 - drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 2 - drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 1 - drivers/gpu/drm/nouveau/dispnv50/head.c | 2 - drivers/gpu/drm/omapdrm/omap_crtc.c | 1 - drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 1 - drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 1 - drivers/gpu/drm/stm/ltdc.c | 1 - drivers/gpu/drm/vc4/vc4_crtc.c | 1 - drivers/gpu/drm/vc4/vc4_txp.c | 1 - include/drm/drm_atomic_helper.h | 4 - include/drm/drm_crtc.h | 3 + 22 files changed, 135 insertions(+), 109 deletions(-)