From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vandana Kannan Subject: Re: [PATCH] drm/edid: Fill PAR in AVI infoframe based on CEA mode list Date: Tue, 01 Apr 2014 08:06:04 +0530 Message-ID: <533A2614.8040501@intel.com> References: <1395370889-16664-1-git-send-email-vandana.kannan@intel.com> <20140331190504.GZ22327@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20140331190504.GZ22327@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Daniel Vetter Cc: "intel-gfx@lists.freedesktop.org" , "Barnes, Jesse" , "dri-devel@lists.freedesktop.org" , "Purushothaman, Vijay A" List-Id: intel-gfx@lists.freedesktop.org On Apr-01-2014 12:35 AM, Daniel Vetter wrote: > On Fri, Mar 21, 2014 at 08:31:29AM +0530, Vandana Kannan wrote: >> Populate PAR in infoframe structure. If there is a user setting for PAR,= then >> that value is set. Else, value is taken from CEA mode list if VIC is fou= nd. >> Else, PAR is calculated from resolution. If none of these conditions are >> satisfied, PAR is NONE as per initialization. >> >> As a next step, create a property that would enable a user space app to = set >> aspect ratio. (will be pushed as a separate patch) >> >> Signed-off-by: Vandana Kannan >> Cc: Jesse Barnes >> Cc: Vijay Purushothaman >> Cc: Ville Syrj=E4l=E4 >> Cc: intel-gfx@lists.freedesktop.org >> --- >> drivers/gpu/drm/drm_edid.c | 34 ++++++++++++++++++++++++++++++++++ >> include/drm/drm_crtc.h | 1 + >> 2 files changed, 35 insertions(+) >> >> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c >> index d4e3f9d..3db693f 100644 >> --- a/drivers/gpu/drm/drm_edid.c >> +++ b/drivers/gpu/drm/drm_edid.c >> @@ -2452,6 +2452,21 @@ u8 drm_match_cea_mode(const struct drm_display_mo= de *to_match) >> } >> EXPORT_SYMBOL(drm_match_cea_mode); >> = >> +/** >> + * drm_get_cea_aspect_ratio - get the picture aspect ratio correspondin= g to >> + * the input VIC from the CEA mode list >> + * >> + * 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 ve= ndor >> * specific block). >> @@ -3613,6 +3628,25 @@ drm_hdmi_avi_infoframe_from_display_mode(struct h= dmi_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 either CEA mode list or >> + * user input >> + */ >> + if (mode->picture_aspect_ratio =3D=3D HDMI_PICTURE_ASPECT_4_3 || >> + mode->picture_aspect_ratio =3D=3D HDMI_PICTURE_ASPECT_16_9) >> + frame->picture_aspect =3D mode->picture_aspect_ratio; > = > Please pardon my ignorance, but how can userspace actually set this part > of the mode? I couldn't find any code which sets this anywhere ... > -Daniel > = I have submitted a patch to enable user space to set picture aspect ratio through a property.. drm/i915: Add property to set HDMI aspect ratio http://lists.freedesktop.org/archives/intel-gfx/2014-March/042403.html -Vandana >> + else if (frame->video_code > 0) >> + frame->picture_aspect =3D drm_get_cea_aspect_ratio( >> + frame->video_code); >> + else { >> + if (!(mode->vdisplay % 3) && >> + (((mode->vdisplay * 4) / 3) =3D=3D mode->hdisplay)) >> + frame->picture_aspect =3D HDMI_PICTURE_ASPECT_4_3; >> + else if (!(mode->vdisplay % 9) && >> + (((mode->vdisplay * 16) / 9) =3D=3D mode->hdisplay)) >> + frame->picture_aspect =3D HDMI_PICTURE_ASPECT_16_9; >> + } >> + >> 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_devic= e *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.7.9.5 >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/dri-devel > =