From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH v4] drm/edid: Fill PAR in AVI infoframe based on CEA mode list Date: Tue, 1 Apr 2014 19:40:08 +0200 Message-ID: <20140401174008.GN22327@phenom.ffwll.local> References: <1396362141-5220-1-git-send-email-vandana.kannan@intel.com> <1396366670-22602-1-git-send-email-vandana.kannan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) by gabe.freedesktop.org (Postfix) with ESMTP id C42716E7CB for ; Tue, 1 Apr 2014 10:40:13 -0700 (PDT) Received: by mail-we0-f169.google.com with SMTP id w62so6714609wes.28 for ; Tue, 01 Apr 2014 10:40:12 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1396366670-22602-1-git-send-email-vandana.kannan@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Vandana Kannan Cc: intel-gfx@lists.freedesktop.org, "Wu, Fengguang" , Jesse Barnes , dri-devel@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Apr 01, 2014 at 09:07:50PM +0530, Vandana Kannan wrote: > Populate PAR in infoframe structure. PAR is taken from CEA mode list if > VIC is found. Else, PAR is NONE as per initialization. > = > v2: Removed the part which sets PAR according to user input, based on > Daniel's review comments. > = > v3: Removed calculation of PAR for non-CEA modes as per discussion with > Ville. > = > v4: Added description for the param video_code. Absence of the description > led to a warning while executing "make htmldocs", as reported by > Wu, Fengguang. > Modified commit message. > = > A separate patch will be submitted to create a property that would enable= a > user space app to set aspect ratio for AVI infoframe. > = > Signed-off-by: Vandana Kannan > Cc: Jesse Barnes > Cc: Vijay Purushothaman > Cc: Ville Syrj=E4l=E4 > Cc: intel-gfx@lists.freedesktop.org > Cc: Wu, Fengguang > Reviewed-by: Jesse Barnes Applied. btw if I've merged a patch already I prefer a small fixup patch on top of what I have to squash into the main patch. -Daniel > --- > drivers/gpu/drm/drm_edid.c | 22 ++++++++++++++++++++++ > include/drm/drm_crtc.h | 1 + > 2 files changed, 23 insertions(+) > = > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c > index d4e3f9d..b8d6c51 100644 > --- a/drivers/gpu/drm/drm_edid.c > +++ b/drivers/gpu/drm/drm_edid.c > @@ -2452,6 +2452,22 @@ u8 drm_match_cea_mode(const struct drm_display_mod= e *to_match) > } > EXPORT_SYMBOL(drm_match_cea_mode); > = > +/** > + * drm_get_cea_aspect_ratio - get the picture aspect ratio corresponding= to > + * the input VIC from the CEA mode list > + * @video_code: ID given to each of the CEA modes > + * > + * Returns picture aspect ratio > + */ > +enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code) > +{ > + /* return picture aspect ratio for video_code - 1 to access the > + * right array element > + */ > + return edid_cea_modes[video_code-1].picture_aspect_ratio; > +} > +EXPORT_SYMBOL(drm_get_cea_aspect_ratio); > + > /* > * Calculate the alternate clock for HDMI modes (those from the HDMI ven= dor > * specific block). > @@ -3613,6 +3629,12 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hd= mi_avi_infoframe *frame, > frame->video_code =3D drm_match_cea_mode(mode); > = > frame->picture_aspect =3D HDMI_PICTURE_ASPECT_NONE; > + > + /* Populate picture aspect ratio from CEA mode list */ > + if (frame->video_code > 0) > + frame->picture_aspect =3D drm_get_cea_aspect_ratio( > + frame->video_code); > + > frame->active_aspect =3D HDMI_ACTIVE_ASPECT_PICTURE; > frame->scan_mode =3D HDMI_SCAN_MODE_UNDERSCAN; > = > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h > index 27f828c..50dc55a 100644 > --- a/include/drm/drm_crtc.h > +++ b/include/drm/drm_crtc.h > @@ -983,6 +983,7 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device= *dev, > extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, > void *data, struct drm_file *file_priv); > extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match); > +extern enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_= code); > extern bool drm_detect_hdmi_monitor(struct edid *edid); > extern bool drm_detect_monitor_audio(struct edid *edid); > extern bool drm_rgb_quant_range_selectable(struct edid *edid); > -- = > 1.9.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