From: Daniel Vetter Subject: Re: [RFC v2 3/5] drm: Add HDMI infoframe helpers Date: Fri, 7 Dec 2012 20:00:07 +0100 Message-ID: <20121207190006.GZ11556@phenom.ffwll.local> References: <1354725944-1862-1-git-send-email-thierry.reding@avionic-design.de> <1354725944-1862-4-git-send-email-thierry.reding@avionic-design.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f177.google.com (mail-ea0-f177.google.com [209.85.215.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 15302E5D59 for ; Fri, 7 Dec 2012 10:58:37 -0800 (PST) Received: by mail-ea0-f177.google.com with SMTP id c10so286370eaa.36 for ; Fri, 07 Dec 2012 10:58:37 -0800 (PST) Content-Disposition: inline In-Reply-To: <1354725944-1862-4-git-send-email-thierry.reding@avionic-design.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Thierry Reding Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org 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 > +/** > + * 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 -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch