aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVandana Kannan <vandana.kannan@intel.com>2014-04-01 06:56:59 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-04-22 05:08:49 -0400
commit0967e6a5070e336507ce52f09f7297413b966981 (patch)
tree517b3354715342aa6cb77b2970f6b0d7e91e2897
parenta798c10faf62a505d24e5f6213fbaf904a39623f (diff)
drm/edid: Fill PAR in AVI infoframe based on CEA mode list
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 found. Else, PAR is calculated from resolution. If none of these conditions are satisfied, PAR is NONE as per initialization. v2: Removed the part which sets PAR according to user input, based on Daniel's review comments. A separate patch will be submitted to create a property that would enable a user space app to set aspect ratio for AVI infoframe. 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. 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 <vandana.kannan@intel.com> Cc: Jesse Barnes <jesse.barnes@intel.com> Cc: Vijay Purushothaman <vijay.a.purushothaman@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: intel-gfx@lists.freedesktop.org Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> [danvet: Squash in fixup for htmldocs.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_edid.c22
-rw-r--r--include/drm/drm_crtc.h1
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index d4e3f9d9370f..b8d6c5163575 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_mode *to_match)
2452} 2452}
2453EXPORT_SYMBOL(drm_match_cea_mode); 2453EXPORT_SYMBOL(drm_match_cea_mode);
2454 2454
2455/**
2456 * drm_get_cea_aspect_ratio - get the picture aspect ratio corresponding to
2457 * the input VIC from the CEA mode list
2458 * @video_code: ID given to each of the CEA modes
2459 *
2460 * Returns picture aspect ratio
2461 */
2462enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code)
2463{
2464 /* return picture aspect ratio for video_code - 1 to access the
2465 * right array element
2466 */
2467 return edid_cea_modes[video_code-1].picture_aspect_ratio;
2468}
2469EXPORT_SYMBOL(drm_get_cea_aspect_ratio);
2470
2455/* 2471/*
2456 * Calculate the alternate clock for HDMI modes (those from the HDMI vendor 2472 * Calculate the alternate clock for HDMI modes (those from the HDMI vendor
2457 * specific block). 2473 * specific block).
@@ -3613,6 +3629,12 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
3613 frame->video_code = drm_match_cea_mode(mode); 3629 frame->video_code = drm_match_cea_mode(mode);
3614 3630
3615 frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE; 3631 frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
3632
3633 /* Populate picture aspect ratio from CEA mode list */
3634 if (frame->video_code > 0)
3635 frame->picture_aspect = drm_get_cea_aspect_ratio(
3636 frame->video_code);
3637
3616 frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE; 3638 frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE;
3617 frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN; 3639 frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN;
3618 3640
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index e55fccbe7c42..c061bb372199 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -1020,6 +1020,7 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
1020extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, 1020extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
1021 void *data, struct drm_file *file_priv); 1021 void *data, struct drm_file *file_priv);
1022extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match); 1022extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
1023extern enum hdmi_picture_aspect drm_get_cea_aspect_ratio(const u8 video_code);
1023extern bool drm_detect_hdmi_monitor(struct edid *edid); 1024extern bool drm_detect_hdmi_monitor(struct edid *edid);
1024extern bool drm_detect_monitor_audio(struct edid *edid); 1025extern bool drm_detect_monitor_audio(struct edid *edid);
1025extern bool drm_rgb_quant_range_selectable(struct edid *edid); 1026extern bool drm_rgb_quant_range_selectable(struct edid *edid);