drm/i915: factor out GMCH panel fitting code and use for eDP
Subsystems (2)
PATCH 1/1 drm/i915: factor out GMCH panel fitting code and use for eDP
This gets the panel fitter working on eDP on VLV, and should also apply to eDP panels on G4x chipsets (if we ever detect and mark an all-in-one panel as eDP anyway).
A few cleanups are still possible on top of this, for example the LVDS border control could be placed in the LVDS encoder structure and updated based on the result of the panel fitter calculation.
Multi-pipe fitting isn't handled correctly either if we ever get a config that wants to try the panel fitter on more than one output at a time.
Signed-off-by Jesse Barnes <[email protected]>
--- drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/intel_display.c | 18 +++ drivers/gpu/drm/i915/intel_dp.c | 12 +- drivers/gpu/drm/i915/intel_drv.h | 4 + drivers/gpu/drm/i915/intel_lvds.c | 207 +--------------------------------- drivers/gpu/drm/i915/intel_panel.c | 187 ++++++++++++++++++++++++++++++ 6 files changed, 225 insertions(+), 205 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -1027,6 +1027,8 @@ typedef struct drm_i915_private {/* Panel fitter placement and size for Ironlake+ */ u32 pch_pf_pos, pch_pf_size; +u32 pfit_control, pfit_pgm_ratios; +struct drm_crtc *plane_to_crtc_mapping[3 ];struct drm_crtc *pipe_to_crtc_mapping[3 ];wait_queue_head_t pending_flip_queue;
drivers/gpu/drm/i915/intel_display.c +18 -0
@@ -3846,6 +3846,24 @@ static void i9xx_crtc_enable(struct drm_crtc *crtc) port, I915_READ(DPLL(0))); } +/* Enable panel fitting for LVDS */ +if (dev_priv->pfit_control && + (intel_pipe_has_type (crtc,INTEL_OUTPUT_EDP ) || +intel_pipe_has_type (crtc,INTEL_OUTPUT_LVDS ))) { +/* +* Enable automatic panel scaling so that non-native modes +* fill the screen. The panel fitter should only be +* adjusted whilst the pipe is disabled, according to +* register description and PRM. +*/ +DRM_DEBUG_KMS ("applying panel-fitter: %x, %x\n" , + dev_priv->pfit_control, + dev_priv->pfit_pgm_ratios); + +I915_WRITE (PFIT_PGM_RATIOS , dev_priv->pfit_pgm_ratios); +I915_WRITE (PFIT_CONTROL , dev_priv->pfit_control); + } +intel_enable_pipe (dev_priv, pipe, false);intel_enable_plane (dev_priv, plane, pipe);if (IS_G4X (dev))
drivers/gpu/drm/i915/intel_dp.c +9 -3
@@ -669,6 +669,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode;struct drm_display_mode *mode = &pipe_config->requested_mode;struct intel_dp *intel_dp =enc_to_intel_dp (&encoder->base); +struct intel_crtc *intel_crtc = encoder->new_crtc;struct intel_connector *intel_connector = intel_dp->attached_connector;int lane_count, clock;int max_lane_count =drm_dp_max_lane_count (intel_dp->dpcd);
@@ -685,9 +686,14 @@ intel_dp_compute_config(struct intel_encoder *encoder,if (is_edp (intel_dp) && intel_connector->panel.fixed_mode) {intel_fixed_panel_mode (intel_connector->panel.fixed_mode, adjusted_mode); -intel_pch_panel_fitting (dev, - intel_connector->panel.fitting_mode, - mode, adjusted_mode); +if (!HAS_PCH_SPLIT (dev)) +intel_gmch_panel_fitting (intel_crtc, + intel_connector->panel.fitting_mode, + mode, adjusted_mode); +else +intel_pch_panel_fitting (dev, + intel_connector->panel.fitting_mode, + mode, adjusted_mode); }/* We need to take the panel's fixed mode into account. */ target_clock = adjusted_mode->clock;
drivers/gpu/drm/i915/intel_drv.h +4 -0
@@ -527,6 +527,10 @@ extern void intel_pch_panel_fitting(struct drm_device *dev,int fitting_mode, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode); +extern void intel_gmch_panel_fitting (struct intel_crtc *crtc, +int fitting_mode, +const struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode);extern u32 intel_panel_get_max_backlight (struct drm_device *dev);extern void intel_panel_set_backlight (struct drm_device *dev,u32 level);extern int intel_panel_setup_backlight (struct drm_connector *connector);
drivers/gpu/drm/i915/intel_lvds.c +5 -202
257 lines not on this page · raw message
drivers/gpu/drm/i915/intel_panel.c +187 -0
193 lines not on this page · raw message
Signature · 1 line
1.7.10.4