From 49fe0ca468957584a119d3bb475fb3e115e09267 Mon Sep 17 00:00:00 2001 From: Cho KyongHo Date: Thu, 12 Oct 2017 17:03:25 +0900 Subject: [PATCH] [COMMON] video: hdr: add tunable parameters for HDR It is required to tune HDR LUT values during runtime because the quality of HDR processing is measured on the display of DUT. It means that some LUT values including LUTs of tone mapping might need to be tunned if the display controller or LCD is changed. Change-Id: Ic927345a25f6b2d45d7be9de47f2a0574514ff64 Signed-off-by: Cho KyongHo --- drivers/gpu/exynos/Kconfig | 12 +++++ drivers/gpu/exynos/Makefile | 1 + drivers/gpu/exynos/hdr_tunables.c | 68 +++++++++++++++++++++++++++++ include/video/exynos_hdr_tunables.h | 22 ++++++++++ 4 files changed, 103 insertions(+) create mode 100644 drivers/gpu/exynos/hdr_tunables.c create mode 100644 include/video/exynos_hdr_tunables.h diff --git a/drivers/gpu/exynos/Kconfig b/drivers/gpu/exynos/Kconfig index e9bf19f4f52e..8dd2387b8cdb 100644 --- a/drivers/gpu/exynos/Kconfig +++ b/drivers/gpu/exynos/Kconfig @@ -1,3 +1,15 @@ + +config EXYNOS_HDR_TUNABLE_TONEMAPPING + bool "HDR Tuneable debugfs nodes for Tone mapping" + ---help--- + Creates hdr/tm_x and hdr/tm_y nodes under debugfs for overriding the + tone mapping LUT coefficients configured in G2D and DPU with the + values stored in the nodes. Configuring 33 integer values to both + nodes immediately replaces the tone mapping LUT coefficients used by + G2D and DPU. Writing 0 to one of both nodes stops overriding. + + This is just for display tunning purpose only for HDR videos. + menu "Exynos Graphic Devices" source "drivers/gpu/exynos/g2d/Kconfig" endmenu diff --git a/drivers/gpu/exynos/Makefile b/drivers/gpu/exynos/Makefile index a00af4e1b64c..d5e3b24f1679 100644 --- a/drivers/gpu/exynos/Makefile +++ b/drivers/gpu/exynos/Makefile @@ -1 +1,2 @@ +obj-$(CONFIG_EXYNOS_HDR_TUNABLE_TONEMAPPING) += hdr_tunables.o obj-$(CONFIG_EXYNOS_GRAPHICS_G2D) += g2d/ diff --git a/drivers/gpu/exynos/hdr_tunables.c b/drivers/gpu/exynos/hdr_tunables.c new file mode 100644 index 000000000000..891f732b0318 --- /dev/null +++ b/drivers/gpu/exynos/hdr_tunables.c @@ -0,0 +1,68 @@ +/* + * linux/drivers/gpu/exynos/hdr_tunables.c + * + * Copyright (C) 2017 Samsung Electronics Co., Ltd. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + */ + +#include +#include + +#include