Commit 37ade417 authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Jani Nikula

drm/i915: Read hw state into an atomic state struct, v2.

To make this work we load the new hardware state into the
atomic_state, then swap it with the sw state.

This lets us change the force restore path in setup_hw_state()
to use a single call to intel_mode_set() to restore all the
previous state.

As a nice bonus this kills off encoder->new_encoder,
connector->new_enabled and crtc->new_enabled. They were used only
to restore the state after a modeset.

Changes since v1:
- Make sure all possible planes are added with their crtc set,
  so they will be turned off on first modeset.
Signed-off-by: default avatarAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent c347a676
...@@ -395,7 +395,7 @@ int intel_atomic_setup_scalers(struct drm_device *dev, ...@@ -395,7 +395,7 @@ int intel_atomic_setup_scalers(struct drm_device *dev,
return 0; return 0;
} }
static void void
intel_atomic_duplicate_dpll_state(struct drm_i915_private *dev_priv, intel_atomic_duplicate_dpll_state(struct drm_i915_private *dev_priv,
struct intel_shared_dpll_config *shared_dpll) struct intel_shared_dpll_config *shared_dpll)
{ {
......
This diff is collapsed.
...@@ -130,11 +130,6 @@ struct intel_fbdev { ...@@ -130,11 +130,6 @@ struct intel_fbdev {
struct intel_encoder { struct intel_encoder {
struct drm_encoder base; struct drm_encoder base;
/*
* The new crtc this encoder will be driven from. Only differs from
* base->crtc while a modeset is in progress.
*/
struct intel_crtc *new_crtc;
enum intel_output_type type; enum intel_output_type type;
unsigned int cloneable; unsigned int cloneable;
...@@ -195,12 +190,6 @@ struct intel_connector { ...@@ -195,12 +190,6 @@ struct intel_connector {
*/ */
struct intel_encoder *encoder; struct intel_encoder *encoder;
/*
* The new encoder this connector will be driven. Only differs from
* encoder while a modeset is in progress.
*/
struct intel_encoder *new_encoder;
/* Reads out the current hw, returning true if the connector is enabled /* Reads out the current hw, returning true if the connector is enabled
* and active (i.e. dpms ON state). */ * and active (i.e. dpms ON state). */
bool (*get_hw_state)(struct intel_connector *); bool (*get_hw_state)(struct intel_connector *);
...@@ -535,7 +524,6 @@ struct intel_crtc { ...@@ -535,7 +524,6 @@ struct intel_crtc {
struct intel_initial_plane_config plane_config; struct intel_initial_plane_config plane_config;
struct intel_crtc_state *config; struct intel_crtc_state *config;
bool new_enabled;
/* reset counter value when the last flip was submitted */ /* reset counter value when the last flip was submitted */
unsigned int reset_counter; unsigned int reset_counter;
...@@ -1416,6 +1404,8 @@ struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev); ...@@ -1416,6 +1404,8 @@ struct drm_atomic_state *intel_atomic_state_alloc(struct drm_device *dev);
void intel_atomic_state_clear(struct drm_atomic_state *); void intel_atomic_state_clear(struct drm_atomic_state *);
struct intel_shared_dpll_config * struct intel_shared_dpll_config *
intel_atomic_get_shared_dpll_state(struct drm_atomic_state *s); intel_atomic_get_shared_dpll_state(struct drm_atomic_state *s);
void intel_atomic_duplicate_dpll_state(struct drm_i915_private *,
struct intel_shared_dpll_config *);
static inline struct intel_crtc_state * static inline struct intel_crtc_state *
intel_atomic_get_crtc_state(struct drm_atomic_state *state, intel_atomic_get_crtc_state(struct drm_atomic_state *state,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment