blob: a457d3328e7440d5caaab17b4d0bcf97ee7a2557 [file] [log] [blame]
From bcb29d1b90c9e5781d56e22fbe2e62d825070531 Mon Sep 17 00:00:00 2001
From: "Lespiau, Damien" <damien.lespiau@intel.com>
Date: Mon, 19 Aug 2013 16:59:02 +0100
Subject: video/hdmi: Use hdmi_vendor_infoframe for the HDMI specific infoframe
We just got rid of the version of hdmi_vendor_infoframe that had a byte
array for anyone to poke at. It's now time to shuffle around the naming
of hdmi_hdmi_infoframe to make hdmi_vendor_infoframe become the HDMI
vendor specific structure.
Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
(cherry picked from commit ae84b900b009589a7017a1f8f060edd7de501642)
Signed-off-by: James Ausmus <james.ausmus@intel.com>
Conflicts:
drivers/gpu/host1x/drm/hdmi.c
(context changes)
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
drivers/gpu/host1x/drm/hdmi.c | 20 ++------------------
drivers/video/hdmi.c | 25 +++++++++++++------------
include/linux/hdmi.h | 15 ++++++++-------
3 files changed, 23 insertions(+), 37 deletions(-)
diff --git a/drivers/gpu/host1x/drm/hdmi.c b/drivers/gpu/host1x/drm/hdmi.c
index 01097da09f7f..52e3c9641a0f 100644
--- a/drivers/gpu/host1x/drm/hdmi.c
+++ b/drivers/gpu/host1x/drm/hdmi.c
@@ -551,24 +551,8 @@ static void tegra_hdmi_setup_stereo_infoframe(struct tegra_hdmi *hdmi)
return;
}
- memset(&frame, 0, sizeof(frame));
-
- frame.type = HDMI_INFOFRAME_TYPE_VENDOR;
- frame.version = 0x01;
- frame.length = 6;
-
- frame.data[0] = 0x03; /* regid0 */
- frame.data[1] = 0x0c; /* regid1 */
- frame.data[2] = 0x00; /* regid2 */
- frame.data[3] = 0x02 << 5; /* video format */
-
- /* TODO: 74 MHz limit? */
- if (1) {
- frame.data[4] = 0x00 << 4; /* 3D structure */
- } else {
- frame.data[4] = 0x08 << 4; /* 3D structure */
- frame.data[5] = 0x00 << 4; /* 3D ext. data */
- }
+ hdmi_vendor_infoframe_init(&frame);
+ frame.s3d_struct = HDMI_3D_STRUCTURE_FRAME_PACKING;
err = hdmi_vendor_infoframe_pack(&frame, buffer, sizeof(buffer));
if (err < 0) {
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index 4d79791e6ebc..e22ea8b16a1d 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -288,12 +288,12 @@ ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame,
EXPORT_SYMBOL(hdmi_audio_infoframe_pack);
/**
- * hdmi_hdmi_infoframe_init() - initialize an HDMI vendor infoframe
+ * hdmi_vendor_infoframe_init() - initialize an HDMI vendor infoframe
* @frame: HDMI vendor infoframe
*
* Returns 0 on success or a negative error code on failure.
*/
-int hdmi_hdmi_infoframe_init(struct hdmi_hdmi_infoframe *frame)
+int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame)
{
memset(frame, 0, sizeof(*frame));
@@ -310,10 +310,10 @@ int hdmi_hdmi_infoframe_init(struct hdmi_hdmi_infoframe *frame)
return 0;
}
-EXPORT_SYMBOL(hdmi_hdmi_infoframe_init);
+EXPORT_SYMBOL(hdmi_vendor_infoframe_init);
/**
- * hdmi_hdmi_infoframe_pack() - write a HDMI vendor infoframe to binary buffer
+ * hdmi_vendor_infoframe_pack() - write a HDMI vendor infoframe to binary buffer
* @frame: HDMI infoframe
* @buffer: destination buffer
* @size: size of buffer
@@ -326,7 +326,7 @@ EXPORT_SYMBOL(hdmi_hdmi_infoframe_init);
* Returns the number of bytes packed into the binary buffer or a negative
* error code on failure.
*/
-ssize_t hdmi_hdmi_infoframe_pack(struct hdmi_hdmi_infoframe *frame,
+ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame,
void *buffer, size_t size)
{
u8 *ptr = buffer;
@@ -377,19 +377,20 @@ ssize_t hdmi_hdmi_infoframe_pack(struct hdmi_hdmi_infoframe *frame,
return length;
}
-EXPORT_SYMBOL(hdmi_hdmi_infoframe_pack);
+EXPORT_SYMBOL(hdmi_vendor_infoframe_pack);
/*
- * hdmi_vendor_infoframe_pack() - write a vendor infoframe to binary buffer
+ * hdmi_vendor_any_infoframe_pack() - write a vendor infoframe to binary buffer
*/
-static ssize_t hdmi_vendor_infoframe_pack(union hdmi_vendor_infoframe *frame,
- void *buffer, size_t size)
+static ssize_t
+hdmi_vendor_any_infoframe_pack(union hdmi_vendor_any_infoframe *frame,
+ void *buffer, size_t size)
{
/* we only know about HDMI vendor infoframes */
if (frame->any.oui != HDMI_IDENTIFIER)
return -EINVAL;
- return hdmi_hdmi_infoframe_pack(&frame->hdmi, buffer, size);
+ return hdmi_vendor_infoframe_pack(&frame->hdmi, buffer, size);
}
/**
@@ -422,8 +423,8 @@ hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size)
length = hdmi_audio_infoframe_pack(&frame->audio, buffer, size);
break;
case HDMI_INFOFRAME_TYPE_VENDOR:
- length = hdmi_vendor_infoframe_pack(&frame->vendor,
- buffer, size);
+ length = hdmi_vendor_any_infoframe_pack(&frame->vendor,
+ buffer, size);
break;
default:
WARN(1, "Bad infoframe type %d\n", frame->any.type);
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index e24d850a8ee6..d4ae12c7931b 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -237,7 +237,8 @@ enum hdmi_3d_structure {
HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF = 8,
};
-struct hdmi_hdmi_infoframe {
+
+struct hdmi_vendor_infoframe {
enum hdmi_infoframe_type type;
unsigned char version;
unsigned char length;
@@ -247,25 +248,25 @@ struct hdmi_hdmi_infoframe {
unsigned int s3d_ext_data;
};
-int hdmi_hdmi_infoframe_init(struct hdmi_hdmi_infoframe *frame);
-ssize_t hdmi_hdmi_infoframe_pack(struct hdmi_hdmi_infoframe *frame,
- void *buffer, size_t size);
+int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame);
+ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame,
+ void *buffer, size_t size);
-union hdmi_vendor_infoframe {
+union hdmi_vendor_any_infoframe {
struct {
enum hdmi_infoframe_type type;
unsigned char version;
unsigned char length;
unsigned int oui;
} any;
- struct hdmi_hdmi_infoframe hdmi;
+ struct hdmi_vendor_infoframe hdmi;
};
union hdmi_infoframe {
struct hdmi_any_infoframe any;
struct hdmi_avi_infoframe avi;
struct hdmi_spd_infoframe spd;
- union hdmi_vendor_infoframe vendor;
+ union hdmi_vendor_any_infoframe vendor;
struct hdmi_audio_infoframe audio;
};
--
1.8.5.rc3