summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-02-15 17:01:37 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-02-15 17:01:36 -0800
commit70d13ef76a14126795c53c619d47ec0e9dd49f2b (patch)
tree551a43503f41b067bffe662a83b87a69234a3b8d /drivers/video/fbdev
parentb574c4b1dc6cd964fca7330446485fc61e42cb5b (diff)
parent2f815283c7407af289432810ff3c89278dffca11 (diff)
Merge "msm: mdss: Add HDR Metadata Interface"
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_tx.c29
-rw-r--r--drivers/video/fbdev/msm/mdss_hdmi_tx.h30
2 files changed, 15 insertions, 44 deletions
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.c b/drivers/video/fbdev/msm/mdss_hdmi_tx.c
index 5804d88e5af5..f05d4cb2922a 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_tx.c
+++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.c
@@ -1251,7 +1251,6 @@ static ssize_t hdmi_tx_sysfs_wta_hdr_stream(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
int ret = 0;
- u32 const hdr_param_count = 13;
struct hdmi_tx_ctrl *ctrl = NULL;
ctrl = hdmi_tx_get_drvdata_from_sysfs_dev(dev);
@@ -1267,26 +1266,14 @@ static ssize_t hdmi_tx_sysfs_wta_hdr_stream(struct device *dev,
goto end;
}
- if (sscanf(buf, "%u %u %u %u %u %u %u %u %u %u %u %u %u",
- &ctrl->hdr_data.eotf,
- &ctrl->hdr_data.display_primaries_x[0],
- &ctrl->hdr_data.display_primaries_y[0],
- &ctrl->hdr_data.display_primaries_x[1],
- &ctrl->hdr_data.display_primaries_y[1],
- &ctrl->hdr_data.display_primaries_x[2],
- &ctrl->hdr_data.display_primaries_y[2],
- &ctrl->hdr_data.white_point_x,
- &ctrl->hdr_data.white_point_y,
- &ctrl->hdr_data.max_luminance,
- &ctrl->hdr_data.min_luminance,
- &ctrl->hdr_data.max_content_light_level,
- &ctrl->hdr_data.max_average_light_level)
- != hdr_param_count) {
- pr_err("%s: Invalid HDR stream data\n", __func__);
+ if (buf == NULL) {
+ pr_err("%s: hdr stream is NULL\n", __func__);
ret = -EINVAL;
goto end;
}
+ memcpy(&ctrl->hdr_data, buf, sizeof(struct mdp_hdr_stream));
+
pr_debug("%s: 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
__func__,
ctrl->hdr_data.eotf,
@@ -1306,6 +1293,14 @@ static ssize_t hdmi_tx_sysfs_wta_hdr_stream(struct device *dev,
ctrl->hdr_data.max_content_light_level,
ctrl->hdr_data.max_average_light_level);
+ pr_debug("%s: 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
+ __func__,
+ ctrl->hdr_data.pixel_encoding,
+ ctrl->hdr_data.colorimetry,
+ ctrl->hdr_data.range,
+ ctrl->hdr_data.bits_per_component,
+ ctrl->hdr_data.content_type);
+
hdmi_panel_set_hdr_infoframe(ctrl);
ret = strnlen(buf, PAGE_SIZE);
diff --git a/drivers/video/fbdev/msm/mdss_hdmi_tx.h b/drivers/video/fbdev/msm/mdss_hdmi_tx.h
index ca316a350238..3469b8a5819f 100644
--- a/drivers/video/fbdev/msm/mdss_hdmi_tx.h
+++ b/drivers/video/fbdev/msm/mdss_hdmi_tx.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2010-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -14,13 +14,13 @@
#define __MDSS_HDMI_TX_H__
#include <linux/switch.h>
+#include <linux/msm_mdp_ext.h>
#include "mdss_hdmi_util.h"
#include "mdss_hdmi_panel.h"
#include "mdss_cec_core.h"
#include "mdss_hdmi_audio.h"
#define MAX_SWITCH_NAME_SIZE 5
-#define HDR_PRIMARIES_COUNT 3
enum hdmi_tx_io_type {
HDMI_TX_CORE_IO,
@@ -62,30 +62,6 @@ struct hdmi_tx_pinctrl {
struct hdmi_tx_ctrl;
typedef int (*hdmi_tx_evt_handler) (struct hdmi_tx_ctrl *);
-/*
- * struct hdmi_tx_hdr_stream - HDR video stream characteristics
- * @eotf: Electro-Optical Transfer Function
- * @display_primaries_x: display primaries data for x-coordinate
- * @display_primaries_y: display primaries data for y-coordinate
- * @white_point_x: white point data for x-coordinate
- * @white_point_y: white point data for y-coordinate
- * @max_luminance: content maximum luminance
- * @min_luminance: content minimum luminance
- * @max_content_light_level: content maximum light level
- * @max_average_light_level: content average light level
- */
-struct hdmi_tx_hdr_stream_data {
- u32 eotf;
- u32 display_primaries_x[HDR_PRIMARIES_COUNT];
- u32 display_primaries_y[HDR_PRIMARIES_COUNT];
- u32 white_point_x;
- u32 white_point_y;
- u32 max_luminance;
- u32 min_luminance;
- u32 max_content_light_level;
- u32 max_average_light_level;
-};
-
struct hdmi_tx_ctrl {
struct platform_device *pdev;
struct platform_device *ext_pdev;
@@ -114,7 +90,7 @@ struct hdmi_tx_ctrl {
struct msm_ext_disp_audio_setup_params audio_params;
struct msm_ext_disp_init_data ext_audio_data;
struct work_struct fps_work;
- struct hdmi_tx_hdr_stream_data hdr_data;
+ struct mdp_hdr_stream hdr_data;
spinlock_t hpd_state_lock;