On Wed, Dec 05, 2012 at 05:45:42PM +0100, Thierry Reding wrote:
Add a generic helper to fill in an HDMI AVI infoframe with data extracted from a DRM display mode.
Signed-off-by: Thierry Reding thierry.reding@avionic-design.de
+/**
- drm_hdmi_avi_infoframe_from_display_mode() - fill an HDMI AVI infoframe with
data from a DRM display mode
- @frame: HDMI AVI infoframe
- @mode: DRM display mode
- Returns 0 on success or a negative error code on failure.
- */
Another request: Can you please integrate the kerneldoc reference into the drm documentation? That way their a bit more accessible, and the kerneldoc generation also checks whether the function declaration still matches up with the kerneldoc - some drm core stuff has gotten ridiculously out of sync with reality ... -Daniel
+int +drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
const struct drm_display_mode *mode)
+{
- int err;
- if (!frame || !mode)
return -EINVAL;
- err = hdmi_avi_infoframe_init(frame);
- if (err < 0)
return err;
- frame->video_code = drm_mode_cea_vic(mode);
- if (!frame->video_code)
return 0;
- frame->picture_aspect = drm_display_mode_get_aspect(mode);
- frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE;
- return 0;
+} +EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode); diff --git a/include/drm/drm_hdmi.h b/include/drm/drm_hdmi.h new file mode 100644 index 0000000..e20462d --- /dev/null +++ b/include/drm/drm_hdmi.h @@ -0,0 +1,19 @@ +/*
- Copyright (C) 2012 Avionic Design GmbH
- 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.
- */
+#ifndef _DRM_HDMI_H_ +#define _DRM_HDMI_H_
+struct hdmi_avi_infoframe; +struct drm_display_mode;
+int +drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
const struct drm_display_mode *mode);
+#endif
1.8.0.1
dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel