summaryrefslogtreecommitdiffstats
path: root/include/linux/hdmi.h
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2018-09-21 10:33:32 -0400
committerVille Syrjälä <ville.syrjala@linux.intel.com>2018-10-03 10:51:56 -0400
commitc5e69ab35c0d7069ad860c5cb44a5986e2322160 (patch)
tree6c979be541a0fe69a63ad473b3f9bf2fbf54c045 /include/linux/hdmi.h
parent469a9308adfcfaa85c85f02fec9fdecd9e38fe07 (diff)
video/hdmi: Constify infoframe passed to the pack functions
Let's make the infoframe pack functions usable with a const infoframe structure. This allows us to precompute the infoframe earlier, and still pack it later when we're no longer allowed to modify the structure. So now we end up with a _check()+_pack_only() or _pack() functions depending on whether you want to precompute the infoframes or not. The names aren't great but I was lazy and didn't want to change all the drivers. v2: Deal with exynos churn Actually export the new funcs v3: Fix various documentation fails (Hans) Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Hans Verkuil <hans.verkuil@cisco.com> Cc: linux-media@vger.kernel.org Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180921143332.28970-1-ville.syrjala@linux.intel.com Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'include/linux/hdmi.h')
-rw-r--r--include/linux/hdmi.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index bce1abb1fe57..c76b50a48e48 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -163,6 +163,9 @@ struct hdmi_avi_infoframe {
163int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame); 163int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame);
164ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer, 164ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer,
165 size_t size); 165 size_t size);
166ssize_t hdmi_avi_infoframe_pack_only(const struct hdmi_avi_infoframe *frame,
167 void *buffer, size_t size);
168int hdmi_avi_infoframe_check(struct hdmi_avi_infoframe *frame);
166 169
167enum hdmi_spd_sdi { 170enum hdmi_spd_sdi {
168 HDMI_SPD_SDI_UNKNOWN, 171 HDMI_SPD_SDI_UNKNOWN,
@@ -194,6 +197,9 @@ int hdmi_spd_infoframe_init(struct hdmi_spd_infoframe *frame,
194 const char *vendor, const char *product); 197 const char *vendor, const char *product);
195ssize_t hdmi_spd_infoframe_pack(struct hdmi_spd_infoframe *frame, void *buffer, 198ssize_t hdmi_spd_infoframe_pack(struct hdmi_spd_infoframe *frame, void *buffer,
196 size_t size); 199 size_t size);
200ssize_t hdmi_spd_infoframe_pack_only(const struct hdmi_spd_infoframe *frame,
201 void *buffer, size_t size);
202int hdmi_spd_infoframe_check(struct hdmi_spd_infoframe *frame);
197 203
198enum hdmi_audio_coding_type { 204enum hdmi_audio_coding_type {
199 HDMI_AUDIO_CODING_TYPE_STREAM, 205 HDMI_AUDIO_CODING_TYPE_STREAM,
@@ -272,6 +278,9 @@ struct hdmi_audio_infoframe {
272int hdmi_audio_infoframe_init(struct hdmi_audio_infoframe *frame); 278int hdmi_audio_infoframe_init(struct hdmi_audio_infoframe *frame);
273ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame, 279ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame,
274 void *buffer, size_t size); 280 void *buffer, size_t size);
281ssize_t hdmi_audio_infoframe_pack_only(const struct hdmi_audio_infoframe *frame,
282 void *buffer, size_t size);
283int hdmi_audio_infoframe_check(struct hdmi_audio_infoframe *frame);
275 284
276enum hdmi_3d_structure { 285enum hdmi_3d_structure {
277 HDMI_3D_STRUCTURE_INVALID = -1, 286 HDMI_3D_STRUCTURE_INVALID = -1,
@@ -299,6 +308,9 @@ struct hdmi_vendor_infoframe {
299int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame); 308int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame);
300ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame, 309ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame,
301 void *buffer, size_t size); 310 void *buffer, size_t size);
311ssize_t hdmi_vendor_infoframe_pack_only(const struct hdmi_vendor_infoframe *frame,
312 void *buffer, size_t size);
313int hdmi_vendor_infoframe_check(struct hdmi_vendor_infoframe *frame);
302 314
303union hdmi_vendor_any_infoframe { 315union hdmi_vendor_any_infoframe {
304 struct { 316 struct {
@@ -330,8 +342,11 @@ union hdmi_infoframe {
330 struct hdmi_audio_infoframe audio; 342 struct hdmi_audio_infoframe audio;
331}; 343};
332 344
333ssize_t 345ssize_t hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer,
334hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size); 346 size_t size);
347ssize_t hdmi_infoframe_pack_only(const union hdmi_infoframe *frame,
348 void *buffer, size_t size);
349int hdmi_infoframe_check(union hdmi_infoframe *frame);
335int hdmi_infoframe_unpack(union hdmi_infoframe *frame, 350int hdmi_infoframe_unpack(union hdmi_infoframe *frame,
336 const void *buffer, size_t size); 351 const void *buffer, size_t size);
337void hdmi_infoframe_log(const char *level, struct device *dev, 352void hdmi_infoframe_log(const char *level, struct device *dev,