* [PATCH 1/6] drm/atomic: add connectors_changed to separate it from mode_changed, v2
2015-07-21 11:28 [PATCH 0/6] drm/i915: Fastboot for everyone! Maarten Lankhorst
@ 2015-07-21 11:28 ` Maarten Lankhorst
2015-07-23 12:27 ` Ander Conselvan De Oliveira
2015-07-21 11:28 ` [PATCH 2/6] drm/atomic: pass old crtc state to atomic_begin/flush Maarten Lankhorst
` (4 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Maarten Lankhorst @ 2015-07-21 11:28 UTC (permalink / raw)
To: intel-gfx; +Cc: dri-devel
This can be a separate case from mode_changed, when connectors stay the
same but only the mode is different. Drivers may choose to implement specific
optimizations to prevent a full modeset for this case.
Changes since v1:
- Update kerneldocs slightly.
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/drm_atomic_helper.c | 39 +++++++++++++++++++++++++++---------
drivers/gpu/drm/i915/intel_display.c | 2 +-
include/drm/drm_atomic.h | 3 ++-
include/drm/drm_crtc.h | 8 +++++---
4 files changed, 38 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 0ea8c5d476ef..ac6601071414 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -124,7 +124,7 @@ steal_encoder(struct drm_atomic_state *state,
if (IS_ERR(crtc_state))
return PTR_ERR(crtc_state);
- crtc_state->mode_changed = true;
+ crtc_state->connectors_changed = true;
list_for_each_entry(connector, &config->connector_list, head) {
if (connector->state->best_encoder != encoder)
@@ -174,14 +174,14 @@ update_connector_routing(struct drm_atomic_state *state, int conn_idx)
idx = drm_crtc_index(connector->state->crtc);
crtc_state = state->crtc_states[idx];
- crtc_state->mode_changed = true;
+ crtc_state->connectors_changed = true;
}
if (connector_state->crtc) {
idx = drm_crtc_index(connector_state->crtc);
crtc_state = state->crtc_states[idx];
- crtc_state->mode_changed = true;
+ crtc_state->connectors_changed = true;
}
}
@@ -233,7 +233,7 @@ update_connector_routing(struct drm_atomic_state *state, int conn_idx)
idx = drm_crtc_index(connector_state->crtc);
crtc_state = state->crtc_states[idx];
- crtc_state->mode_changed = true;
+ crtc_state->connectors_changed = true;
DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d]\n",
connector->base.id,
@@ -256,7 +256,8 @@ mode_fixup(struct drm_atomic_state *state)
bool ret;
for_each_crtc_in_state(state, crtc, crtc_state, i) {
- if (!crtc_state->mode_changed)
+ if (!crtc_state->mode_changed &&
+ !crtc_state->connectors_changed)
continue;
drm_mode_copy(&crtc_state->adjusted_mode, &crtc_state->mode);
@@ -312,7 +313,8 @@ mode_fixup(struct drm_atomic_state *state)
for_each_crtc_in_state(state, crtc, crtc_state, i) {
const struct drm_crtc_helper_funcs *funcs;
- if (!crtc_state->mode_changed)
+ if (!crtc_state->mode_changed &&
+ !crtc_state->connectors_changed)
continue;
funcs = crtc->helper_private;
@@ -338,9 +340,14 @@ mode_fixup(struct drm_atomic_state *state)
*
* Check the state object to see if the requested state is physically possible.
* This does all the crtc and connector related computations for an atomic
- * update. It computes and updates crtc_state->mode_changed, adds any additional
- * connectors needed for full modesets and calls down into ->mode_fixup
- * functions of the driver backend.
+ * update and adds any additional connectors needed for full modesets and calls
+ * down into ->mode_fixup functions of the driver backend.
+ *
+ * crtc_state->mode_changed is set when the input mode is changed.
+ * crtc_state->connectors_changed is set when a connector is added or
+ * removed from the crtc.
+ * crtc_state->active_changed is set when crtc_state->active changes,
+ * which is used for dpms.
*
* IMPORTANT:
*
@@ -373,7 +380,17 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
if (crtc->state->enable != crtc_state->enable) {
DRM_DEBUG_ATOMIC("[CRTC:%d] enable changed\n",
crtc->base.id);
+
+ /*
+ * For clarity this assignment is done here, but
+ * enable == 0 is only true when there are no
+ * connectors and a NULL mode.
+ *
+ * The other way around is true as well. enable != 0
+ * iff connectors are attached and a mode is set.
+ */
crtc_state->mode_changed = true;
+ crtc_state->connectors_changed = true;
}
}
@@ -448,6 +465,9 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);
* This does all the plane update related checks using by calling into the
* ->atomic_check hooks provided by the driver.
*
+ * It also sets crtc_state->planes_changed to indicate that a crtc has
+ * updated planes.
+ *
* RETURNS
* Zero for success or -errno
*/
@@ -2081,6 +2101,7 @@ void __drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc,
state->mode_changed = false;
state->active_changed = false;
state->planes_changed = false;
+ state->connectors_changed = false;
state->event = NULL;
}
EXPORT_SYMBOL(__drm_atomic_helper_crtc_duplicate_state);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 6867267115ce..671ca2820f82 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -413,7 +413,7 @@ static const intel_limit_t intel_limits_bxt = {
static bool
needs_modeset(struct drm_crtc_state *state)
{
- return state->mode_changed || state->active_changed;
+ return drm_atomic_crtc_needs_modeset(state);
}
/**
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 8a3a913320eb..e67aeac2aee0 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -166,7 +166,8 @@ int __must_check drm_atomic_async_commit(struct drm_atomic_state *state);
static inline bool
drm_atomic_crtc_needs_modeset(struct drm_crtc_state *state)
{
- return state->mode_changed || state->active_changed;
+ return state->mode_changed || state->active_changed ||
+ state->connectors_changed;
}
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 8159a0627b6b..3628bd89abf6 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -255,12 +255,13 @@ struct drm_atomic_state;
* @crtc: backpointer to the CRTC
* @enable: whether the CRTC should be enabled, gates all other state
* @active: whether the CRTC is actively displaying (used for DPMS)
- * @mode_changed: for use by helpers and drivers when computing state updates
- * @active_changed: for use by helpers and drivers when computing state updates
+ * @planes_changed: planes on this crtc are updated
+ * @mode_changed: crtc_state->mode or crtc_state->enable has been changed
+ * @active_changed: crtc_state->active has been toggled.
+ * @connectors_changed: connectors to this crtc have been updated
* @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes
* @last_vblank_count: for helpers and drivers to capture the vblank of the
* update to ensure framebuffer cleanup isn't done too early
- * @planes_changed: for use by helpers and drivers when computing state updates
* @adjusted_mode: for use by helpers and drivers to compute adjusted mode timings
* @mode: current mode timings
* @event: optional pointer to a DRM event to signal upon completion of the
@@ -283,6 +284,7 @@ struct drm_crtc_state {
bool planes_changed : 1;
bool mode_changed : 1;
bool active_changed : 1;
+ bool connectors_changed : 1;
/* attached planes bitmask:
* WARNING: transitional helpers do not maintain plane_mask so
--
2.1.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 1/6] drm/atomic: add connectors_changed to separate it from mode_changed, v2
2015-07-21 11:28 ` [PATCH 1/6] drm/atomic: add connectors_changed to separate it from mode_changed, v2 Maarten Lankhorst
@ 2015-07-23 12:27 ` Ander Conselvan De Oliveira
0 siblings, 0 replies; 15+ messages in thread
From: Ander Conselvan De Oliveira @ 2015-07-23 12:27 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx; +Cc: dri-devel
On Tue, 2015-07-21 at 13:28 +0200, Maarten Lankhorst wrote:
> This can be a separate case from mode_changed, when connectors stay
> the
> same but only the mode is different. Drivers may choose to implement
> specific
> optimizations to prevent a full modeset for this case.
>
> Changes since v1:
> - Update kerneldocs slightly.
>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
I have a couple of nits below, but anyway,
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 39
> +++++++++++++++++++++++++++---------
> drivers/gpu/drm/i915/intel_display.c | 2 +-
> include/drm/drm_atomic.h | 3 ++-
> include/drm/drm_crtc.h | 8 +++++---
> 4 files changed, 38 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> b/drivers/gpu/drm/drm_atomic_helper.c
> index 0ea8c5d476ef..ac6601071414 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -124,7 +124,7 @@ steal_encoder(struct drm_atomic_state *state,
> if (IS_ERR(crtc_state))
> return PTR_ERR(crtc_state);
>
> - crtc_state->mode_changed = true;
> + crtc_state->connectors_changed = true;
>
> list_for_each_entry(connector, &config->connector_list,
> head) {
> if (connector->state->best_encoder != encoder)
> @@ -174,14 +174,14 @@ update_connector_routing(struct
> drm_atomic_state *state, int conn_idx)
> idx = drm_crtc_index(connector->state
> ->crtc);
>
> crtc_state = state->crtc_states[idx];
> - crtc_state->mode_changed = true;
> + crtc_state->connectors_changed = true;
> }
>
> if (connector_state->crtc) {
> idx = drm_crtc_index(connector_state->crtc);
>
> crtc_state = state->crtc_states[idx];
> - crtc_state->mode_changed = true;
> + crtc_state->connectors_changed = true;
> }
> }
>
> @@ -233,7 +233,7 @@ update_connector_routing(struct drm_atomic_state
> *state, int conn_idx)
> idx = drm_crtc_index(connector_state->crtc);
>
> crtc_state = state->crtc_states[idx];
> - crtc_state->mode_changed = true;
> + crtc_state->connectors_changed = true;
>
There's a comment above the call to update_connector_routing() that
mentions setting crtc_state->mode_changed. That should be updated to
reflect the changes above.
> DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on
> [CRTC:%d]\n",
> connector->base.id,
>
[...]
> @@ -338,9 +340,14 @@ mode_fixup(struct drm_atomic_state *state)
> *
> * Check the state object to see if the requested state is physically possible.
> * This does all the crtc and connector related computations for an atomic
> - * update. It computes and updates crtc_state->mode_changed, adds any additional
> - * connectors needed for full modesets and calls down into ->mode_fixup
> - * functions of the driver backend.
> + * update and adds any additional connectors needed for full modesets and calls
The first 'and' should be replaced with a comma.
[...]
Ander
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 2/6] drm/atomic: pass old crtc state to atomic_begin/flush.
2015-07-21 11:28 [PATCH 0/6] drm/i915: Fastboot for everyone! Maarten Lankhorst
2015-07-21 11:28 ` [PATCH 1/6] drm/atomic: add connectors_changed to separate it from mode_changed, v2 Maarten Lankhorst
@ 2015-07-21 11:28 ` Maarten Lankhorst
2015-07-23 12:37 ` Ander Conselvan De Oliveira
2015-08-05 6:18 ` Tomi Valkeinen
2015-07-21 11:28 ` [PATCH 3/6] drm/i915: Set csc coefficients in update_pipe_size Maarten Lankhorst
` (3 subsequent siblings)
5 siblings, 2 replies; 15+ messages in thread
From: Maarten Lankhorst @ 2015-07-21 11:28 UTC (permalink / raw)
To: intel-gfx; +Cc: dri-devel
In intel it's useful to keep track of some state changes with old
crtc state vs new state, for example to disable initial planes or
when a modeset's prevented during fastboot.
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 6 ++++--
drivers/gpu/drm/drm_atomic_helper.c | 8 ++++----
drivers/gpu/drm/drm_plane_helper.c | 4 ++--
drivers/gpu/drm/i915/intel_display.c | 10 ++++++----
drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c | 6 ++++--
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 6 ++++--
drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 6 ++++--
drivers/gpu/drm/sti/sti_drm_crtc.c | 6 ++++--
drivers/gpu/drm/tegra/dc.c | 6 ++++--
include/drm/drm_crtc_helper.h | 6 ++++--
10 files changed, 40 insertions(+), 24 deletions(-)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
index f69b92535505..8b8fe3762ca9 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
@@ -239,7 +239,8 @@ static int atmel_hlcdc_crtc_atomic_check(struct drm_crtc *c,
return atmel_hlcdc_plane_prepare_disc_area(s);
}
-static void atmel_hlcdc_crtc_atomic_begin(struct drm_crtc *c)
+static void atmel_hlcdc_crtc_atomic_begin(struct drm_crtc *c,
+ struct drm_crtc_state *old_s)
{
struct atmel_hlcdc_crtc *crtc = drm_crtc_to_atmel_hlcdc_crtc(c);
@@ -253,7 +254,8 @@ static void atmel_hlcdc_crtc_atomic_begin(struct drm_crtc *c)
}
}
-static void atmel_hlcdc_crtc_atomic_flush(struct drm_crtc *crtc)
+static void atmel_hlcdc_crtc_atomic_flush(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_s)
{
/* TODO: write common plane control register if available */
}
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index ac6601071414..4a48d76c4fb1 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1170,7 +1170,7 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev,
if (!funcs || !funcs->atomic_begin)
continue;
- funcs->atomic_begin(crtc);
+ funcs->atomic_begin(crtc, old_crtc_state);
}
for_each_plane_in_state(old_state, plane, old_plane_state, i) {
@@ -1200,7 +1200,7 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev,
if (!funcs || !funcs->atomic_flush)
continue;
- funcs->atomic_flush(crtc);
+ funcs->atomic_flush(crtc, old_crtc_state);
}
}
EXPORT_SYMBOL(drm_atomic_helper_commit_planes);
@@ -1236,7 +1236,7 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
crtc_funcs = crtc->helper_private;
if (crtc_funcs && crtc_funcs->atomic_begin)
- crtc_funcs->atomic_begin(crtc);
+ crtc_funcs->atomic_begin(crtc, old_crtc_state);
drm_for_each_plane_mask(plane, crtc->dev, plane_mask) {
struct drm_plane_state *old_plane_state =
@@ -1259,7 +1259,7 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
}
if (crtc_funcs && crtc_funcs->atomic_flush)
- crtc_funcs->atomic_flush(crtc);
+ crtc_funcs->atomic_flush(crtc, old_crtc_state);
}
EXPORT_SYMBOL(drm_atomic_helper_commit_planes_on_crtc);
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index 03b7afe455e6..cb5dab4c4337 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -436,7 +436,7 @@ int drm_plane_helper_commit(struct drm_plane *plane,
for (i = 0; i < 2; i++) {
if (crtc_funcs[i] && crtc_funcs[i]->atomic_begin)
- crtc_funcs[i]->atomic_begin(crtc[i]);
+ crtc_funcs[i]->atomic_begin(crtc[i], crtc[i]->state);
}
/*
@@ -451,7 +451,7 @@ int drm_plane_helper_commit(struct drm_plane *plane,
for (i = 0; i < 2; i++) {
if (crtc_funcs[i] && crtc_funcs[i]->atomic_flush)
- crtc_funcs[i]->atomic_flush(crtc[i]);
+ crtc_funcs[i]->atomic_flush(crtc[i], crtc[i]->state);
}
/*
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 671ca2820f82..def9444eeae2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -102,8 +102,8 @@ static void vlv_prepare_pll(struct intel_crtc *crtc,
const struct intel_crtc_state *pipe_config);
static void chv_prepare_pll(struct intel_crtc *crtc,
const struct intel_crtc_state *pipe_config);
-static void intel_begin_crtc_commit(struct drm_crtc *crtc);
-static void intel_finish_crtc_commit(struct drm_crtc *crtc);
+static void intel_begin_crtc_commit(struct drm_crtc *, struct drm_crtc_state *);
+static void intel_finish_crtc_commit(struct drm_crtc *, struct drm_crtc_state *);
static void skl_init_scalers(struct drm_device *dev, struct intel_crtc *intel_crtc,
struct intel_crtc_state *crtc_state);
static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
@@ -13440,7 +13440,8 @@ intel_disable_primary_plane(struct drm_plane *plane,
dev_priv->display.update_primary_plane(crtc, NULL, 0, 0);
}
-static void intel_begin_crtc_commit(struct drm_crtc *crtc)
+static void intel_begin_crtc_commit(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state)
{
struct drm_device *dev = crtc->dev;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
@@ -13456,7 +13457,8 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc)
skl_detach_scalers(intel_crtc);
}
-static void intel_finish_crtc_commit(struct drm_crtc *crtc)
+static void intel_finish_crtc_commit(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state)
{
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
index c4bb9d9c7667..4dc158ed2e95 100644
--- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
+++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
@@ -334,13 +334,15 @@ static int mdp4_crtc_atomic_check(struct drm_crtc *crtc,
return 0;
}
-static void mdp4_crtc_atomic_begin(struct drm_crtc *crtc)
+static void mdp4_crtc_atomic_begin(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state)
{
struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc);
DBG("%s: begin", mdp4_crtc->name);
}
-static void mdp4_crtc_atomic_flush(struct drm_crtc *crtc)
+static void mdp4_crtc_atomic_flush(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state)
{
struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc);
struct drm_device *dev = crtc->dev;
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
index dea3d2e559b1..4c1df4e6e5bc 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
@@ -388,13 +388,15 @@ static int mdp5_crtc_atomic_check(struct drm_crtc *crtc,
return 0;
}
-static void mdp5_crtc_atomic_begin(struct drm_crtc *crtc)
+static void mdp5_crtc_atomic_begin(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state)
{
struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
DBG("%s: begin", mdp5_crtc->name);
}
-static void mdp5_crtc_atomic_flush(struct drm_crtc *crtc)
+static void mdp5_crtc_atomic_flush(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state)
{
struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
struct drm_device *dev = crtc->dev;
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
index 65d6ba6621ac..48cb19949ca3 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
@@ -496,7 +496,8 @@ static bool rcar_du_crtc_mode_fixup(struct drm_crtc *crtc,
return true;
}
-static void rcar_du_crtc_atomic_begin(struct drm_crtc *crtc)
+static void rcar_du_crtc_atomic_begin(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state)
{
struct drm_pending_vblank_event *event = crtc->state->event;
struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
@@ -512,7 +513,8 @@ static void rcar_du_crtc_atomic_begin(struct drm_crtc *crtc)
}
}
-static void rcar_du_crtc_atomic_flush(struct drm_crtc *crtc)
+static void rcar_du_crtc_atomic_flush(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state)
{
struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
diff --git a/drivers/gpu/drm/sti/sti_drm_crtc.c b/drivers/gpu/drm/sti/sti_drm_crtc.c
index 6b641c5a2ec7..26e63bf14efe 100644
--- a/drivers/gpu/drm/sti/sti_drm_crtc.c
+++ b/drivers/gpu/drm/sti/sti_drm_crtc.c
@@ -164,7 +164,8 @@ sti_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
sti_drm_crtc_mode_set(crtc, &crtc->state->adjusted_mode);
}
-static void sti_drm_atomic_begin(struct drm_crtc *crtc)
+static void sti_drm_atomic_begin(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state)
{
struct sti_mixer *mixer = to_sti_mixer(crtc);
@@ -178,7 +179,8 @@ static void sti_drm_atomic_begin(struct drm_crtc *crtc)
}
}
-static void sti_drm_atomic_flush(struct drm_crtc *crtc)
+static void sti_drm_atomic_flush(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state)
{
}
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index d447701173e6..24b38090dfd3 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1275,7 +1275,8 @@ static int tegra_crtc_atomic_check(struct drm_crtc *crtc,
return 0;
}
-static void tegra_crtc_atomic_begin(struct drm_crtc *crtc)
+static void tegra_crtc_atomic_begin(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state)
{
struct tegra_dc *dc = to_tegra_dc(crtc);
@@ -1289,7 +1290,8 @@ static void tegra_crtc_atomic_begin(struct drm_crtc *crtc)
}
}
-static void tegra_crtc_atomic_flush(struct drm_crtc *crtc)
+static void tegra_crtc_atomic_flush(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state)
{
struct tegra_dc_state *state = to_dc_state(crtc->state);
struct tegra_dc *dc = to_tegra_dc(crtc);
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index 4562bd12bb4a..800e0d1cf32c 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -108,8 +108,10 @@ struct drm_crtc_helper_funcs {
/* atomic helpers */
int (*atomic_check)(struct drm_crtc *crtc,
struct drm_crtc_state *state);
- void (*atomic_begin)(struct drm_crtc *crtc);
- void (*atomic_flush)(struct drm_crtc *crtc);
+ void (*atomic_begin)(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state);
+ void (*atomic_flush)(struct drm_crtc *crtc,
+ struct drm_crtc_state *old_crtc_state);
};
/**
--
2.1.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 2/6] drm/atomic: pass old crtc state to atomic_begin/flush.
2015-07-21 11:28 ` [PATCH 2/6] drm/atomic: pass old crtc state to atomic_begin/flush Maarten Lankhorst
@ 2015-07-23 12:37 ` Ander Conselvan De Oliveira
2015-08-05 6:18 ` Tomi Valkeinen
1 sibling, 0 replies; 15+ messages in thread
From: Ander Conselvan De Oliveira @ 2015-07-23 12:37 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx; +Cc: dri-devel
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
On Tue, 2015-07-21 at 13:28 +0200, Maarten Lankhorst wrote:
> In intel it's useful to keep track of some state changes with old
> crtc state vs new state, for example to disable initial planes or
> when a modeset's prevented during fastboot.
>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 6 ++++--
> drivers/gpu/drm/drm_atomic_helper.c | 8 ++++----
> drivers/gpu/drm/drm_plane_helper.c | 4 ++--
> drivers/gpu/drm/i915/intel_display.c | 10 ++++++----
> drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c | 6 ++++--
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 6 ++++--
> drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 6 ++++--
> drivers/gpu/drm/sti/sti_drm_crtc.c | 6 ++++--
> drivers/gpu/drm/tegra/dc.c | 6 ++++--
> include/drm/drm_crtc_helper.h | 6 ++++--
> 10 files changed, 40 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index f69b92535505..8b8fe3762ca9 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -239,7 +239,8 @@ static int atmel_hlcdc_crtc_atomic_check(struct
> drm_crtc *c,
> return atmel_hlcdc_plane_prepare_disc_area(s);
> }
>
> -static void atmel_hlcdc_crtc_atomic_begin(struct drm_crtc *c)
> +static void atmel_hlcdc_crtc_atomic_begin(struct drm_crtc *c,
> + struct drm_crtc_state
> *old_s)
> {
> struct atmel_hlcdc_crtc *crtc =
> drm_crtc_to_atmel_hlcdc_crtc(c);
>
> @@ -253,7 +254,8 @@ static void atmel_hlcdc_crtc_atomic_begin(struct
> drm_crtc *c)
> }
> }
>
> -static void atmel_hlcdc_crtc_atomic_flush(struct drm_crtc *crtc)
> +static void atmel_hlcdc_crtc_atomic_flush(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_s)
> {
> /* TODO: write common plane control register if available */
> }
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> b/drivers/gpu/drm/drm_atomic_helper.c
> index ac6601071414..4a48d76c4fb1 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1170,7 +1170,7 @@ void drm_atomic_helper_commit_planes(struct
> drm_device *dev,
> if (!funcs || !funcs->atomic_begin)
> continue;
>
> - funcs->atomic_begin(crtc);
> + funcs->atomic_begin(crtc, old_crtc_state);
> }
>
> for_each_plane_in_state(old_state, plane, old_plane_state,
> i) {
> @@ -1200,7 +1200,7 @@ void drm_atomic_helper_commit_planes(struct
> drm_device *dev,
> if (!funcs || !funcs->atomic_flush)
> continue;
>
> - funcs->atomic_flush(crtc);
> + funcs->atomic_flush(crtc, old_crtc_state);
> }
> }
> EXPORT_SYMBOL(drm_atomic_helper_commit_planes);
> @@ -1236,7 +1236,7 @@ drm_atomic_helper_commit_planes_on_crtc(struct
> drm_crtc_state *old_crtc_state)
>
> crtc_funcs = crtc->helper_private;
> if (crtc_funcs && crtc_funcs->atomic_begin)
> - crtc_funcs->atomic_begin(crtc);
> + crtc_funcs->atomic_begin(crtc, old_crtc_state);
>
> drm_for_each_plane_mask(plane, crtc->dev, plane_mask) {
> struct drm_plane_state *old_plane_state =
> @@ -1259,7 +1259,7 @@ drm_atomic_helper_commit_planes_on_crtc(struct
> drm_crtc_state *old_crtc_state)
> }
>
> if (crtc_funcs && crtc_funcs->atomic_flush)
> - crtc_funcs->atomic_flush(crtc);
> + crtc_funcs->atomic_flush(crtc, old_crtc_state);
> }
> EXPORT_SYMBOL(drm_atomic_helper_commit_planes_on_crtc);
>
> diff --git a/drivers/gpu/drm/drm_plane_helper.c
> b/drivers/gpu/drm/drm_plane_helper.c
> index 03b7afe455e6..cb5dab4c4337 100644
> --- a/drivers/gpu/drm/drm_plane_helper.c
> +++ b/drivers/gpu/drm/drm_plane_helper.c
> @@ -436,7 +436,7 @@ int drm_plane_helper_commit(struct drm_plane
> *plane,
>
> for (i = 0; i < 2; i++) {
> if (crtc_funcs[i] && crtc_funcs[i]->atomic_begin)
> - crtc_funcs[i]->atomic_begin(crtc[i]);
> + crtc_funcs[i]->atomic_begin(crtc[i], crtc[i]
> ->state);
> }
>
> /*
> @@ -451,7 +451,7 @@ int drm_plane_helper_commit(struct drm_plane
> *plane,
>
> for (i = 0; i < 2; i++) {
> if (crtc_funcs[i] && crtc_funcs[i]->atomic_flush)
> - crtc_funcs[i]->atomic_flush(crtc[i]);
> + crtc_funcs[i]->atomic_flush(crtc[i], crtc[i]
> ->state);
> }
>
> /*
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index 671ca2820f82..def9444eeae2 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -102,8 +102,8 @@ static void vlv_prepare_pll(struct intel_crtc
> *crtc,
> const struct intel_crtc_state
> *pipe_config);
> static void chv_prepare_pll(struct intel_crtc *crtc,
> const struct intel_crtc_state
> *pipe_config);
> -static void intel_begin_crtc_commit(struct drm_crtc *crtc);
> -static void intel_finish_crtc_commit(struct drm_crtc *crtc);
> +static void intel_begin_crtc_commit(struct drm_crtc *, struct
> drm_crtc_state *);
> +static void intel_finish_crtc_commit(struct drm_crtc *, struct
> drm_crtc_state *);
> static void skl_init_scalers(struct drm_device *dev, struct
> intel_crtc *intel_crtc,
> struct intel_crtc_state *crtc_state);
> static int i9xx_get_refclk(const struct intel_crtc_state
> *crtc_state,
> @@ -13440,7 +13440,8 @@ intel_disable_primary_plane(struct drm_plane
> *plane,
> dev_priv->display.update_primary_plane(crtc, NULL, 0, 0);
> }
>
> -static void intel_begin_crtc_commit(struct drm_crtc *crtc)
> +static void intel_begin_crtc_commit(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_crtc_state)
> {
> struct drm_device *dev = crtc->dev;
> struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> @@ -13456,7 +13457,8 @@ static void intel_begin_crtc_commit(struct
> drm_crtc *crtc)
> skl_detach_scalers(intel_crtc);
> }
>
> -static void intel_finish_crtc_commit(struct drm_crtc *crtc)
> +static void intel_finish_crtc_commit(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_crtc_state)
> {
> struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>
> diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
> b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
> index c4bb9d9c7667..4dc158ed2e95 100644
> --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
> +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c
> @@ -334,13 +334,15 @@ static int mdp4_crtc_atomic_check(struct
> drm_crtc *crtc,
> return 0;
> }
>
> -static void mdp4_crtc_atomic_begin(struct drm_crtc *crtc)
> +static void mdp4_crtc_atomic_begin(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_crtc_state)
> {
> struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc);
> DBG("%s: begin", mdp4_crtc->name);
> }
>
> -static void mdp4_crtc_atomic_flush(struct drm_crtc *crtc)
> +static void mdp4_crtc_atomic_flush(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_crtc_state)
> {
> struct mdp4_crtc *mdp4_crtc = to_mdp4_crtc(crtc);
> struct drm_device *dev = crtc->dev;
> diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
> b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
> index dea3d2e559b1..4c1df4e6e5bc 100644
> --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
> +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
> @@ -388,13 +388,15 @@ static int mdp5_crtc_atomic_check(struct
> drm_crtc *crtc,
> return 0;
> }
>
> -static void mdp5_crtc_atomic_begin(struct drm_crtc *crtc)
> +static void mdp5_crtc_atomic_begin(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_crtc_state)
> {
> struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
> DBG("%s: begin", mdp5_crtc->name);
> }
>
> -static void mdp5_crtc_atomic_flush(struct drm_crtc *crtc)
> +static void mdp5_crtc_atomic_flush(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_crtc_state)
> {
> struct mdp5_crtc *mdp5_crtc = to_mdp5_crtc(crtc);
> struct drm_device *dev = crtc->dev;
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> index 65d6ba6621ac..48cb19949ca3 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> @@ -496,7 +496,8 @@ static bool rcar_du_crtc_mode_fixup(struct
> drm_crtc *crtc,
> return true;
> }
>
> -static void rcar_du_crtc_atomic_begin(struct drm_crtc *crtc)
> +static void rcar_du_crtc_atomic_begin(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_crtc_state)
> {
> struct drm_pending_vblank_event *event = crtc->state->event;
> struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
> @@ -512,7 +513,8 @@ static void rcar_du_crtc_atomic_begin(struct
> drm_crtc *crtc)
> }
> }
>
> -static void rcar_du_crtc_atomic_flush(struct drm_crtc *crtc)
> +static void rcar_du_crtc_atomic_flush(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_crtc_state)
> {
> struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
>
> diff --git a/drivers/gpu/drm/sti/sti_drm_crtc.c
> b/drivers/gpu/drm/sti/sti_drm_crtc.c
> index 6b641c5a2ec7..26e63bf14efe 100644
> --- a/drivers/gpu/drm/sti/sti_drm_crtc.c
> +++ b/drivers/gpu/drm/sti/sti_drm_crtc.c
> @@ -164,7 +164,8 @@ sti_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
> sti_drm_crtc_mode_set(crtc, &crtc->state->adjusted_mode);
> }
>
> -static void sti_drm_atomic_begin(struct drm_crtc *crtc)
> +static void sti_drm_atomic_begin(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_crtc_state)
> {
> struct sti_mixer *mixer = to_sti_mixer(crtc);
>
> @@ -178,7 +179,8 @@ static void sti_drm_atomic_begin(struct drm_crtc
> *crtc)
> }
> }
>
> -static void sti_drm_atomic_flush(struct drm_crtc *crtc)
> +static void sti_drm_atomic_flush(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_crtc_state)
> {
> }
>
> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> index d447701173e6..24b38090dfd3 100644
> --- a/drivers/gpu/drm/tegra/dc.c
> +++ b/drivers/gpu/drm/tegra/dc.c
> @@ -1275,7 +1275,8 @@ static int tegra_crtc_atomic_check(struct
> drm_crtc *crtc,
> return 0;
> }
>
> -static void tegra_crtc_atomic_begin(struct drm_crtc *crtc)
> +static void tegra_crtc_atomic_begin(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_crtc_state)
> {
> struct tegra_dc *dc = to_tegra_dc(crtc);
>
> @@ -1289,7 +1290,8 @@ static void tegra_crtc_atomic_begin(struct
> drm_crtc *crtc)
> }
> }
>
> -static void tegra_crtc_atomic_flush(struct drm_crtc *crtc)
> +static void tegra_crtc_atomic_flush(struct drm_crtc *crtc,
> + struct drm_crtc_state
> *old_crtc_state)
> {
> struct tegra_dc_state *state = to_dc_state(crtc->state);
> struct tegra_dc *dc = to_tegra_dc(crtc);
> diff --git a/include/drm/drm_crtc_helper.h
> b/include/drm/drm_crtc_helper.h
> index 4562bd12bb4a..800e0d1cf32c 100644
> --- a/include/drm/drm_crtc_helper.h
> +++ b/include/drm/drm_crtc_helper.h
> @@ -108,8 +108,10 @@ struct drm_crtc_helper_funcs {
> /* atomic helpers */
> int (*atomic_check)(struct drm_crtc *crtc,
> struct drm_crtc_state *state);
> - void (*atomic_begin)(struct drm_crtc *crtc);
> - void (*atomic_flush)(struct drm_crtc *crtc);
> + void (*atomic_begin)(struct drm_crtc *crtc,
> + struct drm_crtc_state *old_crtc_state);
> + void (*atomic_flush)(struct drm_crtc *crtc,
> + struct drm_crtc_state *old_crtc_state);
> };
>
> /**
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 2/6] drm/atomic: pass old crtc state to atomic_begin/flush.
2015-07-21 11:28 ` [PATCH 2/6] drm/atomic: pass old crtc state to atomic_begin/flush Maarten Lankhorst
2015-07-23 12:37 ` Ander Conselvan De Oliveira
@ 2015-08-05 6:18 ` Tomi Valkeinen
2015-08-06 12:35 ` Maarten Lankhorst
1 sibling, 1 reply; 15+ messages in thread
From: Tomi Valkeinen @ 2015-08-05 6:18 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx; +Cc: dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 1586 bytes --]
Hi,
On 21/07/15 14:28, Maarten Lankhorst wrote:
> In intel it's useful to keep track of some state changes with old
> crtc state vs new state, for example to disable initial planes or
> when a modeset's prevented during fastboot.
>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 6 ++++--
> drivers/gpu/drm/drm_atomic_helper.c | 8 ++++----
> drivers/gpu/drm/drm_plane_helper.c | 4 ++--
> drivers/gpu/drm/i915/intel_display.c | 10 ++++++----
> drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c | 6 ++++--
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 6 ++++--
> drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 6 ++++--
> drivers/gpu/drm/sti/sti_drm_crtc.c | 6 ++++--
> drivers/gpu/drm/tegra/dc.c | 6 ++++--
> include/drm/drm_crtc_helper.h | 6 ++++--
> 10 files changed, 40 insertions(+), 24 deletions(-)
Looks like this broke omapdrm in linux-next:
drivers/gpu/drm/omapdrm/omap_crtc.c:470:2: error: initialization from
incompatible pointer type [-Werror]
drivers/gpu/drm/omapdrm/omap_crtc.c:470:2: error: (near initialization
for ‘omap_crtc_helper_funcs.atomic_begin’) [-Werror]
drivers/gpu/drm/omapdrm/omap_crtc.c:471:2: error: initialization from
incompatible pointer type [-Werror]
drivers/gpu/drm/omapdrm/omap_crtc.c:471:2: error: (near initialization
for ‘omap_crtc_helper_funcs.atomic_flush’) [-Werror]
Tomi
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/6] drm/atomic: pass old crtc state to atomic_begin/flush.
2015-08-05 6:18 ` Tomi Valkeinen
@ 2015-08-06 12:35 ` Maarten Lankhorst
0 siblings, 0 replies; 15+ messages in thread
From: Maarten Lankhorst @ 2015-08-06 12:35 UTC (permalink / raw)
To: Tomi Valkeinen, intel-gfx; +Cc: dri-devel
Hey,
Op 05-08-15 om 08:18 schreef Tomi Valkeinen:
> Hi,
>
> On 21/07/15 14:28, Maarten Lankhorst wrote:
>> In intel it's useful to keep track of some state changes with old
>> crtc state vs new state, for example to disable initial planes or
>> when a modeset's prevented during fastboot.
>>
>> Cc: dri-devel@lists.freedesktop.org
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> ---
>> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 6 ++++--
>> drivers/gpu/drm/drm_atomic_helper.c | 8 ++++----
>> drivers/gpu/drm/drm_plane_helper.c | 4 ++--
>> drivers/gpu/drm/i915/intel_display.c | 10 ++++++----
>> drivers/gpu/drm/msm/mdp/mdp4/mdp4_crtc.c | 6 ++++--
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 6 ++++--
>> drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 6 ++++--
>> drivers/gpu/drm/sti/sti_drm_crtc.c | 6 ++++--
>> drivers/gpu/drm/tegra/dc.c | 6 ++++--
>> include/drm/drm_crtc_helper.h | 6 ++++--
>> 10 files changed, 40 insertions(+), 24 deletions(-)
> Looks like this broke omapdrm in linux-next:
>
> drivers/gpu/drm/omapdrm/omap_crtc.c:470:2: error: initialization from
> incompatible pointer type [-Werror]
> drivers/gpu/drm/omapdrm/omap_crtc.c:470:2: error: (near initialization
> for ‘omap_crtc_helper_funcs.atomic_begin’) [-Werror]
> drivers/gpu/drm/omapdrm/omap_crtc.c:471:2: error: initialization from
> incompatible pointer type [-Werror]
> drivers/gpu/drm/omapdrm/omap_crtc.c:471:2: error: (near initialization
> for ‘omap_crtc_helper_funcs.atomic_flush’) [-Werror]
>
> Tomi
>
This has been fixed up in topic/drm-misc? Compiles for me cleanly there.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/6] drm/i915: Set csc coefficients in update_pipe_size.
2015-07-21 11:28 [PATCH 0/6] drm/i915: Fastboot for everyone! Maarten Lankhorst
2015-07-21 11:28 ` [PATCH 1/6] drm/atomic: add connectors_changed to separate it from mode_changed, v2 Maarten Lankhorst
2015-07-21 11:28 ` [PATCH 2/6] drm/atomic: pass old crtc state to atomic_begin/flush Maarten Lankhorst
@ 2015-07-21 11:28 ` Maarten Lankhorst
2015-07-23 13:25 ` Ander Conselvan De Oliveira
2015-07-21 11:29 ` [PATCH 4/6] drm/i915: Always try to inherit the initial fb Maarten Lankhorst
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Maarten Lankhorst @ 2015-07-21 11:28 UTC (permalink / raw)
To: intel-gfx; +Cc: Daniel Stone
This might not have been set during boot, and when we preserve
the initial mode this can result in a black screen.
Cc: Daniel Stone <daniels@collabora.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index def9444eeae2..443328033981 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3277,6 +3277,9 @@ static void intel_update_pipe_size(struct intel_crtc *crtc)
if (!i915.fastboot)
return;
+ if (HAS_DDI(dev))
+ intel_set_pipe_csc(&crtc->base);
+
/*
* Update pipe size and adjust fitter if needed: the reason for this is
* that in compute_mode_changes we check the native mode (not the pfit
--
2.1.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 3/6] drm/i915: Set csc coefficients in update_pipe_size.
2015-07-21 11:28 ` [PATCH 3/6] drm/i915: Set csc coefficients in update_pipe_size Maarten Lankhorst
@ 2015-07-23 13:25 ` Ander Conselvan De Oliveira
0 siblings, 0 replies; 15+ messages in thread
From: Ander Conselvan De Oliveira @ 2015-07-23 13:25 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx; +Cc: Daniel Stone
On Tue, 2015-07-21 at 13:28 +0200, Maarten Lankhorst wrote:
This might not have been set during boot, and when we preserve
the initial mode this can result in a black screen.
Cc: Daniel Stone <daniels@collabora.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index def9444eeae2..443328033981 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3277,6 +3277,9 @@ static void intel_update_pipe_size(struct intel_crtc *crtc)
if (!i915.fastboot)
return;
+ if (HAS_DDI(dev))
+ intel_set_pipe_csc(&crtc->base);
+
/*
* Update pipe size and adjust fitter if needed: the reason for this is
* that in compute_mode_changes we check the native mode (not the pfit
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4/6] drm/i915: Always try to inherit the initial fb.
2015-07-21 11:28 [PATCH 0/6] drm/i915: Fastboot for everyone! Maarten Lankhorst
` (2 preceding siblings ...)
2015-07-21 11:28 ` [PATCH 3/6] drm/i915: Set csc coefficients in update_pipe_size Maarten Lankhorst
@ 2015-07-21 11:29 ` Maarten Lankhorst
2015-07-21 11:29 ` [PATCH 5/6] drm/i915: Make updating pipe without modeset atomic Maarten Lankhorst
2015-07-21 11:29 ` [PATCH 6/6] drm/i915: skip modeset if compatible for everyone Maarten Lankhorst
5 siblings, 0 replies; 15+ messages in thread
From: Maarten Lankhorst @ 2015-07-21 11:29 UTC (permalink / raw)
To: intel-gfx
The initial state is read out correctly and the state is atomic,
so it's safe to preserve the fb without any hacks if it's suitable.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_fbdev.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 7eff33ff84f6..914679ceb200 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -578,9 +578,6 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
struct intel_crtc *intel_crtc;
unsigned int max_size = 0;
- if (!i915.fastboot)
- return false;
-
/* Find the largest fb */
for_each_crtc(dev, crtc) {
struct drm_i915_gem_object *obj =
--
2.1.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH 5/6] drm/i915: Make updating pipe without modeset atomic.
2015-07-21 11:28 [PATCH 0/6] drm/i915: Fastboot for everyone! Maarten Lankhorst
` (3 preceding siblings ...)
2015-07-21 11:29 ` [PATCH 4/6] drm/i915: Always try to inherit the initial fb Maarten Lankhorst
@ 2015-07-21 11:29 ` Maarten Lankhorst
2015-07-21 14:14 ` Daniel Vetter
2015-07-21 11:29 ` [PATCH 6/6] drm/i915: skip modeset if compatible for everyone Maarten Lankhorst
5 siblings, 1 reply; 15+ messages in thread
From: Maarten Lankhorst @ 2015-07-21 11:29 UTC (permalink / raw)
To: intel-gfx
Instead of doing a hack during primary plane commit the state
is updated during atomic evasion. It handles differences in
pipe size and the panel fitter.
This is continuing on top of Daniel's work to make faster
modesets atomic, and not yet enabled by default.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_atomic.c | 2 +-
drivers/gpu/drm/i915/intel_display.c | 93 ++++++++++++++++++++----------------
drivers/gpu/drm/i915/intel_drv.h | 2 +
3 files changed, 55 insertions(+), 42 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index 09a0ad611002..58d62fbe961b 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -98,8 +98,8 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
return NULL;
__drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->base);
-
crtc_state->base.crtc = crtc;
+ crtc_state->update_pipe = false;
return &crtc_state->base;
}
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 443328033981..480b2336c7ba 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -108,6 +108,9 @@ static void skl_init_scalers(struct drm_device *dev, struct intel_crtc *intel_cr
struct intel_crtc_state *crtc_state);
static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
int num_connectors);
+static void skylake_pfit_enable(struct intel_crtc *crtc);
+static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force);
+static void ironlake_pfit_enable(struct intel_crtc *crtc);
static void intel_modeset_setup_hw_state(struct drm_device *dev);
typedef struct {
@@ -3268,14 +3271,17 @@ static bool intel_crtc_has_pending_flip(struct drm_crtc *crtc)
return pending;
}
-static void intel_update_pipe_size(struct intel_crtc *crtc)
+static void intel_update_pipe_config(struct intel_crtc *crtc,
+ struct intel_crtc_state *old_crtc_state)
{
struct drm_device *dev = crtc->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
- const struct drm_display_mode *adjusted_mode;
+ struct intel_crtc_state *pipe_config =
+ to_intel_crtc_state(crtc->base.state);
- if (!i915.fastboot)
- return;
+ DRM_DEBUG_KMS("Updating pipe size %ix%i -> %ix%i\n",
+ old_crtc_state->pipe_src_w, old_crtc_state->pipe_src_h,
+ pipe_config->pipe_src_w, pipe_config->pipe_src_h);
if (HAS_DDI(dev))
intel_set_pipe_csc(&crtc->base);
@@ -3287,27 +3293,26 @@ static void intel_update_pipe_size(struct intel_crtc *crtc)
* fastboot case, we'll flip, but if we don't update the pipesrc and
* pfit state, we'll end up with a big fb scanned out into the wrong
* sized surface.
- *
- * To fix this properly, we need to hoist the checks up into
- * compute_mode_changes (or above), check the actual pfit state and
- * whether the platform allows pfit disable with pipe active, and only
- * then update the pipesrc and pfit state, even on the flip path.
*/
- adjusted_mode = &crtc->config->base.adjusted_mode;
-
I915_WRITE(PIPESRC(crtc->pipe),
- ((adjusted_mode->crtc_hdisplay - 1) << 16) |
- (adjusted_mode->crtc_vdisplay - 1));
- if (!crtc->config->pch_pfit.enabled &&
- (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) ||
- intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))) {
- I915_WRITE(PF_CTL(crtc->pipe), 0);
- I915_WRITE(PF_WIN_POS(crtc->pipe), 0);
- I915_WRITE(PF_WIN_SZ(crtc->pipe), 0);
+ ((pipe_config->pipe_src_w - 1) << 16) |
+ (pipe_config->pipe_src_h - 1));
+
+ /* on skylake this is done by detaching scalers */
+ if (INTEL_INFO(dev)->gen == 9) {
+ skl_detach_scalers(crtc);
+
+ if (pipe_config->pch_pfit.enabled)
+ skylake_pfit_enable(crtc);
+ }
+ else if (INTEL_INFO(dev)->gen < 9 &&
+ HAS_PCH_SPLIT(dev)) {
+ if (pipe_config->pch_pfit.enabled)
+ ironlake_pfit_enable(crtc);
+ else if (old_crtc_state->pch_pfit.enabled)
+ ironlake_pfit_disable(crtc, true);
}
- crtc->config->pipe_src_w = adjusted_mode->crtc_hdisplay;
- crtc->config->pipe_src_h = adjusted_mode->crtc_vdisplay;
}
static void intel_fdi_normal_train(struct drm_crtc *crtc)
@@ -4956,7 +4961,7 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
}
}
-static void ironlake_pfit_disable(struct intel_crtc *crtc)
+static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force)
{
struct drm_device *dev = crtc->base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
@@ -4964,7 +4969,7 @@ static void ironlake_pfit_disable(struct intel_crtc *crtc)
/* To avoid upsetting the power well on haswell only disable the pfit if
* it's in use. The hw state code will make sure we get this right. */
- if (crtc->config->pch_pfit.enabled) {
+ if (force || crtc->config->pch_pfit.enabled) {
I915_WRITE(PF_CTL(pipe), 0);
I915_WRITE(PF_WIN_POS(pipe), 0);
I915_WRITE(PF_WIN_SZ(pipe), 0);
@@ -4991,7 +4996,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
intel_disable_pipe(intel_crtc);
- ironlake_pfit_disable(intel_crtc);
+ ironlake_pfit_disable(intel_crtc, false);
if (intel_crtc->config->has_pch_encoder)
ironlake_fdi_disable(crtc);
@@ -5054,7 +5059,7 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
if (INTEL_INFO(dev)->gen == 9)
skylake_scaler_disable(intel_crtc);
else if (INTEL_INFO(dev)->gen < 9)
- ironlake_pfit_disable(intel_crtc);
+ ironlake_pfit_disable(intel_crtc, false);
else
MISSING_CASE(INTEL_INFO(dev)->gen);
@@ -5208,7 +5213,8 @@ static void modeset_update_crtc_power_domains(struct drm_atomic_state *state)
int i;
for_each_crtc_in_state(state, crtc, crtc_state, i) {
- if (needs_modeset(crtc->state))
+ if (needs_modeset(crtc->state) ||
+ to_intel_crtc_state(crtc->state)->update_pipe)
put_domains[to_intel_crtc(crtc)->pipe] =
modeset_get_crtc_power_domains(crtc);
}
@@ -12180,7 +12186,6 @@ static bool intel_fuzzy_clock_check(int clock1, int clock2)
base.head) \
if (mask & (1 <<(intel_crtc)->pipe))
-
static bool
intel_compare_m_n(unsigned int m, unsigned int n,
unsigned int m2, unsigned int n2,
@@ -12400,8 +12405,16 @@ intel_pipe_config_compare(struct drm_device *dev,
DRM_MODE_FLAG_NVSYNC);
}
- PIPE_CONF_CHECK_I(pipe_src_w);
- PIPE_CONF_CHECK_I(pipe_src_h);
+ if (!adjust) {
+ PIPE_CONF_CHECK_I(pipe_src_w);
+ PIPE_CONF_CHECK_I(pipe_src_h);
+
+ PIPE_CONF_CHECK_I(pch_pfit.enabled);
+ if (current_config->pch_pfit.enabled) {
+ PIPE_CONF_CHECK_I(pch_pfit.pos);
+ PIPE_CONF_CHECK_I(pch_pfit.size);
+ }
+ }
PIPE_CONF_CHECK_I(gmch_pfit.control);
/* pfit ratios are autocomputed by the hw on gen4+ */
@@ -12409,12 +12422,6 @@ intel_pipe_config_compare(struct drm_device *dev,
PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios);
PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits);
- PIPE_CONF_CHECK_I(pch_pfit.enabled);
- if (current_config->pch_pfit.enabled) {
- PIPE_CONF_CHECK_I(pch_pfit.pos);
- PIPE_CONF_CHECK_I(pch_pfit.size);
- }
-
PIPE_CONF_CHECK_I(scaler_state.scaler_id);
/* BDW+ don't expose a synchronous way to read the state */
@@ -12877,7 +12884,6 @@ static int intel_modeset_all_pipes(struct drm_atomic_state *state)
return ret;
}
-
static int intel_modeset_checks(struct drm_atomic_state *state)
{
struct drm_device *dev = state->dev;
@@ -12968,6 +12974,7 @@ static int intel_atomic_check(struct drm_device *dev,
to_intel_crtc_state(crtc->state),
pipe_config, true)) {
crtc_state->mode_changed = false;
+ to_intel_crtc_state(crtc_state)->update_pipe = true;
}
if (needs_modeset(crtc_state)) {
@@ -13426,10 +13433,6 @@ intel_commit_primary_plane(struct drm_plane *plane,
if (!crtc->state->active)
return;
- if (state->visible)
- /* FIXME: kill this fastboot hack */
- intel_update_pipe_size(intel_crtc);
-
dev_priv->display.update_primary_plane(crtc, fb, crtc->x, crtc->y);
}
@@ -13448,6 +13451,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,
{
struct drm_device *dev = crtc->dev;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+ struct intel_crtc_state *old_intel_state =
+ to_intel_crtc_state(old_crtc_state);
+ bool modeset = needs_modeset(crtc->state);
if (intel_crtc->atomic.update_wm_pre)
intel_update_watermarks(crtc);
@@ -13456,7 +13462,12 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,
if (crtc->state->active)
intel_pipe_update_start(intel_crtc, &intel_crtc->start_vbl_count);
- if (!needs_modeset(crtc->state) && INTEL_INFO(dev)->gen >= 9)
+ if (modeset)
+ return;
+
+ if (to_intel_crtc_state(crtc->state)->update_pipe)
+ intel_update_pipe_config(intel_crtc, old_intel_state);
+ else if (INTEL_INFO(dev)->gen >= 9)
skl_detach_scalers(intel_crtc);
}
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index cbe20250c901..1af5717e2e8a 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -333,6 +333,8 @@ struct intel_crtc_state {
#define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0) /* unreliable sync mode.flags */
unsigned long quirks;
+ bool update_pipe;
+
/* Pipe source size (ie. panel fitter input size)
* All planes will be positioned inside this space,
* and get clipped at the edges. */
--
2.1.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH 5/6] drm/i915: Make updating pipe without modeset atomic.
2015-07-21 11:29 ` [PATCH 5/6] drm/i915: Make updating pipe without modeset atomic Maarten Lankhorst
@ 2015-07-21 14:14 ` Daniel Vetter
2015-07-21 14:32 ` Maarten Lankhorst
0 siblings, 1 reply; 15+ messages in thread
From: Daniel Vetter @ 2015-07-21 14:14 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-gfx
On Tue, Jul 21, 2015 at 01:29:01PM +0200, Maarten Lankhorst wrote:
> Instead of doing a hack during primary plane commit the state
> is updated during atomic evasion. It handles differences in
> pipe size and the panel fitter.
>
> This is continuing on top of Daniel's work to make faster
> modesets atomic, and not yet enabled by default.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_atomic.c | 2 +-
> drivers/gpu/drm/i915/intel_display.c | 93 ++++++++++++++++++++----------------
> drivers/gpu/drm/i915/intel_drv.h | 2 +
> 3 files changed, 55 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index 09a0ad611002..58d62fbe961b 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -98,8 +98,8 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
> return NULL;
>
> __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->base);
> -
> crtc_state->base.crtc = crtc;
> + crtc_state->update_pipe = false;
>
> return &crtc_state->base;
> }
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 443328033981..480b2336c7ba 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -108,6 +108,9 @@ static void skl_init_scalers(struct drm_device *dev, struct intel_crtc *intel_cr
> struct intel_crtc_state *crtc_state);
> static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
> int num_connectors);
> +static void skylake_pfit_enable(struct intel_crtc *crtc);
> +static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force);
> +static void ironlake_pfit_enable(struct intel_crtc *crtc);
> static void intel_modeset_setup_hw_state(struct drm_device *dev);
>
> typedef struct {
> @@ -3268,14 +3271,17 @@ static bool intel_crtc_has_pending_flip(struct drm_crtc *crtc)
> return pending;
> }
>
> -static void intel_update_pipe_size(struct intel_crtc *crtc)
> +static void intel_update_pipe_config(struct intel_crtc *crtc,
> + struct intel_crtc_state *old_crtc_state)
upate_pipe_config sounds like it's just updating the hw state. Maybe call
it intel_fastset_crtc or intel_fixup_crtc or just intel_update_crtc? The
other functions are also called crtc_enable/disable, so going with crtc
seems more consistent.
> {
> struct drm_device *dev = crtc->base.dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> - const struct drm_display_mode *adjusted_mode;
> + struct intel_crtc_state *pipe_config =
> + to_intel_crtc_state(crtc->base.state);
>
> - if (!i915.fastboot)
> - return;
> + DRM_DEBUG_KMS("Updating pipe size %ix%i -> %ix%i\n",
> + old_crtc_state->pipe_src_w, old_crtc_state->pipe_src_h,
> + pipe_config->pipe_src_w, pipe_config->pipe_src_h);
>
> if (HAS_DDI(dev))
> intel_set_pipe_csc(&crtc->base);
> @@ -3287,27 +3293,26 @@ static void intel_update_pipe_size(struct intel_crtc *crtc)
> * fastboot case, we'll flip, but if we don't update the pipesrc and
> * pfit state, we'll end up with a big fb scanned out into the wrong
> * sized surface.
> - *
> - * To fix this properly, we need to hoist the checks up into
> - * compute_mode_changes (or above), check the actual pfit state and
> - * whether the platform allows pfit disable with pipe active, and only
> - * then update the pipesrc and pfit state, even on the flip path.
> */
>
> - adjusted_mode = &crtc->config->base.adjusted_mode;
> -
> I915_WRITE(PIPESRC(crtc->pipe),
> - ((adjusted_mode->crtc_hdisplay - 1) << 16) |
> - (adjusted_mode->crtc_vdisplay - 1));
> - if (!crtc->config->pch_pfit.enabled &&
> - (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) ||
> - intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))) {
> - I915_WRITE(PF_CTL(crtc->pipe), 0);
> - I915_WRITE(PF_WIN_POS(crtc->pipe), 0);
> - I915_WRITE(PF_WIN_SZ(crtc->pipe), 0);
> + ((pipe_config->pipe_src_w - 1) << 16) |
> + (pipe_config->pipe_src_h - 1));
> +
> + /* on skylake this is done by detaching scalers */
> + if (INTEL_INFO(dev)->gen == 9) {
> + skl_detach_scalers(crtc);
> +
> + if (pipe_config->pch_pfit.enabled)
> + skylake_pfit_enable(crtc);
> + }
> + else if (INTEL_INFO(dev)->gen < 9 &&
> + HAS_PCH_SPLIT(dev)) {
> + if (pipe_config->pch_pfit.enabled)
> + ironlake_pfit_enable(crtc);
> + else if (old_crtc_state->pch_pfit.enabled)
> + ironlake_pfit_disable(crtc, true);
Iirc Jesse's experiments showed that you could only disable the pfit
without a modeset, but not enable it without a modeset. Not sure how that
works on skl, but that's what I remember for ealier platforms at least.
Also it should work the same for gmch platforms really.
Also big thing still missing is the special testcase which does direct
modesets trying to force fastset pfit changes on edp/dsi/lvds.
-Daniel
> }
> - crtc->config->pipe_src_w = adjusted_mode->crtc_hdisplay;
> - crtc->config->pipe_src_h = adjusted_mode->crtc_vdisplay;
> }
>
> static void intel_fdi_normal_train(struct drm_crtc *crtc)
> @@ -4956,7 +4961,7 @@ static void haswell_crtc_enable(struct drm_crtc *crtc)
> }
> }
>
> -static void ironlake_pfit_disable(struct intel_crtc *crtc)
> +static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force)
> {
> struct drm_device *dev = crtc->base.dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -4964,7 +4969,7 @@ static void ironlake_pfit_disable(struct intel_crtc *crtc)
>
> /* To avoid upsetting the power well on haswell only disable the pfit if
> * it's in use. The hw state code will make sure we get this right. */
> - if (crtc->config->pch_pfit.enabled) {
> + if (force || crtc->config->pch_pfit.enabled) {
> I915_WRITE(PF_CTL(pipe), 0);
> I915_WRITE(PF_WIN_POS(pipe), 0);
> I915_WRITE(PF_WIN_SZ(pipe), 0);
> @@ -4991,7 +4996,7 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc)
>
> intel_disable_pipe(intel_crtc);
>
> - ironlake_pfit_disable(intel_crtc);
> + ironlake_pfit_disable(intel_crtc, false);
>
> if (intel_crtc->config->has_pch_encoder)
> ironlake_fdi_disable(crtc);
> @@ -5054,7 +5059,7 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
> if (INTEL_INFO(dev)->gen == 9)
> skylake_scaler_disable(intel_crtc);
> else if (INTEL_INFO(dev)->gen < 9)
> - ironlake_pfit_disable(intel_crtc);
> + ironlake_pfit_disable(intel_crtc, false);
> else
> MISSING_CASE(INTEL_INFO(dev)->gen);
>
> @@ -5208,7 +5213,8 @@ static void modeset_update_crtc_power_domains(struct drm_atomic_state *state)
> int i;
>
> for_each_crtc_in_state(state, crtc, crtc_state, i) {
> - if (needs_modeset(crtc->state))
> + if (needs_modeset(crtc->state) ||
> + to_intel_crtc_state(crtc->state)->update_pipe)
> put_domains[to_intel_crtc(crtc)->pipe] =
> modeset_get_crtc_power_domains(crtc);
> }
> @@ -12180,7 +12186,6 @@ static bool intel_fuzzy_clock_check(int clock1, int clock2)
> base.head) \
> if (mask & (1 <<(intel_crtc)->pipe))
>
> -
> static bool
> intel_compare_m_n(unsigned int m, unsigned int n,
> unsigned int m2, unsigned int n2,
> @@ -12400,8 +12405,16 @@ intel_pipe_config_compare(struct drm_device *dev,
> DRM_MODE_FLAG_NVSYNC);
> }
>
> - PIPE_CONF_CHECK_I(pipe_src_w);
> - PIPE_CONF_CHECK_I(pipe_src_h);
> + if (!adjust) {
> + PIPE_CONF_CHECK_I(pipe_src_w);
> + PIPE_CONF_CHECK_I(pipe_src_h);
> +
> + PIPE_CONF_CHECK_I(pch_pfit.enabled);
> + if (current_config->pch_pfit.enabled) {
> + PIPE_CONF_CHECK_I(pch_pfit.pos);
> + PIPE_CONF_CHECK_I(pch_pfit.size);
> + }
> + }
>
> PIPE_CONF_CHECK_I(gmch_pfit.control);
> /* pfit ratios are autocomputed by the hw on gen4+ */
> @@ -12409,12 +12422,6 @@ intel_pipe_config_compare(struct drm_device *dev,
> PIPE_CONF_CHECK_I(gmch_pfit.pgm_ratios);
> PIPE_CONF_CHECK_I(gmch_pfit.lvds_border_bits);
>
> - PIPE_CONF_CHECK_I(pch_pfit.enabled);
> - if (current_config->pch_pfit.enabled) {
> - PIPE_CONF_CHECK_I(pch_pfit.pos);
> - PIPE_CONF_CHECK_I(pch_pfit.size);
> - }
> -
> PIPE_CONF_CHECK_I(scaler_state.scaler_id);
>
> /* BDW+ don't expose a synchronous way to read the state */
> @@ -12877,7 +12884,6 @@ static int intel_modeset_all_pipes(struct drm_atomic_state *state)
> return ret;
> }
>
> -
> static int intel_modeset_checks(struct drm_atomic_state *state)
> {
> struct drm_device *dev = state->dev;
> @@ -12968,6 +12974,7 @@ static int intel_atomic_check(struct drm_device *dev,
> to_intel_crtc_state(crtc->state),
> pipe_config, true)) {
> crtc_state->mode_changed = false;
> + to_intel_crtc_state(crtc_state)->update_pipe = true;
> }
>
> if (needs_modeset(crtc_state)) {
> @@ -13426,10 +13433,6 @@ intel_commit_primary_plane(struct drm_plane *plane,
> if (!crtc->state->active)
> return;
>
> - if (state->visible)
> - /* FIXME: kill this fastboot hack */
> - intel_update_pipe_size(intel_crtc);
> -
> dev_priv->display.update_primary_plane(crtc, fb, crtc->x, crtc->y);
> }
>
> @@ -13448,6 +13451,9 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,
> {
> struct drm_device *dev = crtc->dev;
> struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> + struct intel_crtc_state *old_intel_state =
> + to_intel_crtc_state(old_crtc_state);
> + bool modeset = needs_modeset(crtc->state);
>
> if (intel_crtc->atomic.update_wm_pre)
> intel_update_watermarks(crtc);
> @@ -13456,7 +13462,12 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,
> if (crtc->state->active)
> intel_pipe_update_start(intel_crtc, &intel_crtc->start_vbl_count);
>
> - if (!needs_modeset(crtc->state) && INTEL_INFO(dev)->gen >= 9)
> + if (modeset)
> + return;
> +
> + if (to_intel_crtc_state(crtc->state)->update_pipe)
> + intel_update_pipe_config(intel_crtc, old_intel_state);
> + else if (INTEL_INFO(dev)->gen >= 9)
> skl_detach_scalers(intel_crtc);
> }
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index cbe20250c901..1af5717e2e8a 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -333,6 +333,8 @@ struct intel_crtc_state {
> #define PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS (1<<0) /* unreliable sync mode.flags */
> unsigned long quirks;
>
> + bool update_pipe;
> +
> /* Pipe source size (ie. panel fitter input size)
> * All planes will be positioned inside this space,
> * and get clipped at the edges. */
> --
> 2.1.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 5/6] drm/i915: Make updating pipe without modeset atomic.
2015-07-21 14:14 ` Daniel Vetter
@ 2015-07-21 14:32 ` Maarten Lankhorst
2015-07-21 14:50 ` Daniel Vetter
0 siblings, 1 reply; 15+ messages in thread
From: Maarten Lankhorst @ 2015-07-21 14:32 UTC (permalink / raw)
To: Daniel Vetter; +Cc: intel-gfx
Op 21-07-15 om 16:14 schreef Daniel Vetter:
> On Tue, Jul 21, 2015 at 01:29:01PM +0200, Maarten Lankhorst wrote:
>> Instead of doing a hack during primary plane commit the state
>> is updated during atomic evasion. It handles differences in
>> pipe size and the panel fitter.
>>
>> This is continuing on top of Daniel's work to make faster
>> modesets atomic, and not yet enabled by default.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> ---
>> drivers/gpu/drm/i915/intel_atomic.c | 2 +-
>> drivers/gpu/drm/i915/intel_display.c | 93 ++++++++++++++++++++----------------
>> drivers/gpu/drm/i915/intel_drv.h | 2 +
>> 3 files changed, 55 insertions(+), 42 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
>> index 09a0ad611002..58d62fbe961b 100644
>> --- a/drivers/gpu/drm/i915/intel_atomic.c
>> +++ b/drivers/gpu/drm/i915/intel_atomic.c
>> @@ -98,8 +98,8 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
>> return NULL;
>>
>> __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->base);
>> -
>> crtc_state->base.crtc = crtc;
>> + crtc_state->update_pipe = false;
>>
>> return &crtc_state->base;
>> }
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index 443328033981..480b2336c7ba 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -108,6 +108,9 @@ static void skl_init_scalers(struct drm_device *dev, struct intel_crtc *intel_cr
>> struct intel_crtc_state *crtc_state);
>> static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
>> int num_connectors);
>> +static void skylake_pfit_enable(struct intel_crtc *crtc);
>> +static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force);
>> +static void ironlake_pfit_enable(struct intel_crtc *crtc);
>> static void intel_modeset_setup_hw_state(struct drm_device *dev);
>>
>> typedef struct {
>> @@ -3268,14 +3271,17 @@ static bool intel_crtc_has_pending_flip(struct drm_crtc *crtc)
>> return pending;
>> }
>>
>> -static void intel_update_pipe_size(struct intel_crtc *crtc)
>> +static void intel_update_pipe_config(struct intel_crtc *crtc,
>> + struct intel_crtc_state *old_crtc_state)
> upate_pipe_config sounds like it's just updating the hw state. Maybe call
> it intel_fastset_crtc or intel_fixup_crtc or just intel_update_crtc? The
> other functions are also called crtc_enable/disable, so going with crtc
> seems more consistent.
intel_crtc_update_pipe ?
>> {
>> struct drm_device *dev = crtc->base.dev;
>> struct drm_i915_private *dev_priv = dev->dev_private;
>> - const struct drm_display_mode *adjusted_mode;
>> + struct intel_crtc_state *pipe_config =
>> + to_intel_crtc_state(crtc->base.state);
>>
>> - if (!i915.fastboot)
>> - return;
>> + DRM_DEBUG_KMS("Updating pipe size %ix%i -> %ix%i\n",
>> + old_crtc_state->pipe_src_w, old_crtc_state->pipe_src_h,
>> + pipe_config->pipe_src_w, pipe_config->pipe_src_h);
>>
>> if (HAS_DDI(dev))
>> intel_set_pipe_csc(&crtc->base);
>> @@ -3287,27 +3293,26 @@ static void intel_update_pipe_size(struct intel_crtc *crtc)
>> * fastboot case, we'll flip, but if we don't update the pipesrc and
>> * pfit state, we'll end up with a big fb scanned out into the wrong
>> * sized surface.
>> - *
>> - * To fix this properly, we need to hoist the checks up into
>> - * compute_mode_changes (or above), check the actual pfit state and
>> - * whether the platform allows pfit disable with pipe active, and only
>> - * then update the pipesrc and pfit state, even on the flip path.
>> */
>>
>> - adjusted_mode = &crtc->config->base.adjusted_mode;
>> -
>> I915_WRITE(PIPESRC(crtc->pipe),
>> - ((adjusted_mode->crtc_hdisplay - 1) << 16) |
>> - (adjusted_mode->crtc_vdisplay - 1));
>> - if (!crtc->config->pch_pfit.enabled &&
>> - (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) ||
>> - intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))) {
>> - I915_WRITE(PF_CTL(crtc->pipe), 0);
>> - I915_WRITE(PF_WIN_POS(crtc->pipe), 0);
>> - I915_WRITE(PF_WIN_SZ(crtc->pipe), 0);
>> + ((pipe_config->pipe_src_w - 1) << 16) |
>> + (pipe_config->pipe_src_h - 1));
>> +
>> + /* on skylake this is done by detaching scalers */
>> + if (INTEL_INFO(dev)->gen == 9) {
>> + skl_detach_scalers(crtc);
>> +
>> + if (pipe_config->pch_pfit.enabled)
>> + skylake_pfit_enable(crtc);
>> + }
>> + else if (INTEL_INFO(dev)->gen < 9 &&
>> + HAS_PCH_SPLIT(dev)) {
>> + if (pipe_config->pch_pfit.enabled)
>> + ironlake_pfit_enable(crtc);
>> + else if (old_crtc_state->pch_pfit.enabled)
>> + ironlake_pfit_disable(crtc, true);
> Iirc Jesse's experiments showed that you could only disable the pfit
> without a modeset, but not enable it without a modeset. Not sure how that
> works on skl, but that's what I remember for ealier platforms at least.
Is that really the case, or because of the power domain updates? Which, come to think of it, I don't
handle correctly in this patch. :/
intel_ddi_enable_transcoder_func seems to have a special case for haswell on eDP with panel fitter on/off.
So perhaps disallow off -> on with haswell.
Broadwell might not be able to change panel fitter from on to off, because of cdclk calculations:
broadwell_modeset_calc_cdclk -> ilk_max_pixel_rate -> ilk_pipe_pixel_rate
Those reasons might be contributing to failures.
> Also it should work the same for gmch platforms really.
Probably, but I wasn't able to test it and current code didn't seem to handle it.
> Also big thing still missing is the special testcase which does direct
> modesets trying to force fastset pfit changes on edp/dsi/lvds.
Indeed! What should I expect on failure, and how do I define success?
~Maarten
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH 5/6] drm/i915: Make updating pipe without modeset atomic.
2015-07-21 14:32 ` Maarten Lankhorst
@ 2015-07-21 14:50 ` Daniel Vetter
0 siblings, 0 replies; 15+ messages in thread
From: Daniel Vetter @ 2015-07-21 14:50 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-gfx
On Tue, Jul 21, 2015 at 04:32:26PM +0200, Maarten Lankhorst wrote:
> Op 21-07-15 om 16:14 schreef Daniel Vetter:
> > On Tue, Jul 21, 2015 at 01:29:01PM +0200, Maarten Lankhorst wrote:
> >> Instead of doing a hack during primary plane commit the state
> >> is updated during atomic evasion. It handles differences in
> >> pipe size and the panel fitter.
> >>
> >> This is continuing on top of Daniel's work to make faster
> >> modesets atomic, and not yet enabled by default.
> >>
> >> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> >> ---
> >> drivers/gpu/drm/i915/intel_atomic.c | 2 +-
> >> drivers/gpu/drm/i915/intel_display.c | 93 ++++++++++++++++++++----------------
> >> drivers/gpu/drm/i915/intel_drv.h | 2 +
> >> 3 files changed, 55 insertions(+), 42 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> >> index 09a0ad611002..58d62fbe961b 100644
> >> --- a/drivers/gpu/drm/i915/intel_atomic.c
> >> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> >> @@ -98,8 +98,8 @@ intel_crtc_duplicate_state(struct drm_crtc *crtc)
> >> return NULL;
> >>
> >> __drm_atomic_helper_crtc_duplicate_state(crtc, &crtc_state->base);
> >> -
> >> crtc_state->base.crtc = crtc;
> >> + crtc_state->update_pipe = false;
> >>
> >> return &crtc_state->base;
> >> }
> >> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> >> index 443328033981..480b2336c7ba 100644
> >> --- a/drivers/gpu/drm/i915/intel_display.c
> >> +++ b/drivers/gpu/drm/i915/intel_display.c
> >> @@ -108,6 +108,9 @@ static void skl_init_scalers(struct drm_device *dev, struct intel_crtc *intel_cr
> >> struct intel_crtc_state *crtc_state);
> >> static int i9xx_get_refclk(const struct intel_crtc_state *crtc_state,
> >> int num_connectors);
> >> +static void skylake_pfit_enable(struct intel_crtc *crtc);
> >> +static void ironlake_pfit_disable(struct intel_crtc *crtc, bool force);
> >> +static void ironlake_pfit_enable(struct intel_crtc *crtc);
> >> static void intel_modeset_setup_hw_state(struct drm_device *dev);
> >>
> >> typedef struct {
> >> @@ -3268,14 +3271,17 @@ static bool intel_crtc_has_pending_flip(struct drm_crtc *crtc)
> >> return pending;
> >> }
> >>
> >> -static void intel_update_pipe_size(struct intel_crtc *crtc)
> >> +static void intel_update_pipe_config(struct intel_crtc *crtc,
> >> + struct intel_crtc_state *old_crtc_state)
> > upate_pipe_config sounds like it's just updating the hw state. Maybe call
> > it intel_fastset_crtc or intel_fixup_crtc or just intel_update_crtc? The
> > other functions are also called crtc_enable/disable, so going with crtc
> > seems more consistent.
> intel_crtc_update_pipe ?
>
> >> {
> >> struct drm_device *dev = crtc->base.dev;
> >> struct drm_i915_private *dev_priv = dev->dev_private;
> >> - const struct drm_display_mode *adjusted_mode;
> >> + struct intel_crtc_state *pipe_config =
> >> + to_intel_crtc_state(crtc->base.state);
> >>
> >> - if (!i915.fastboot)
> >> - return;
> >> + DRM_DEBUG_KMS("Updating pipe size %ix%i -> %ix%i\n",
> >> + old_crtc_state->pipe_src_w, old_crtc_state->pipe_src_h,
> >> + pipe_config->pipe_src_w, pipe_config->pipe_src_h);
> >>
> >> if (HAS_DDI(dev))
> >> intel_set_pipe_csc(&crtc->base);
> >> @@ -3287,27 +3293,26 @@ static void intel_update_pipe_size(struct intel_crtc *crtc)
> >> * fastboot case, we'll flip, but if we don't update the pipesrc and
> >> * pfit state, we'll end up with a big fb scanned out into the wrong
> >> * sized surface.
> >> - *
> >> - * To fix this properly, we need to hoist the checks up into
> >> - * compute_mode_changes (or above), check the actual pfit state and
> >> - * whether the platform allows pfit disable with pipe active, and only
> >> - * then update the pipesrc and pfit state, even on the flip path.
> >> */
> >>
> >> - adjusted_mode = &crtc->config->base.adjusted_mode;
> >> -
> >> I915_WRITE(PIPESRC(crtc->pipe),
> >> - ((adjusted_mode->crtc_hdisplay - 1) << 16) |
> >> - (adjusted_mode->crtc_vdisplay - 1));
> >> - if (!crtc->config->pch_pfit.enabled &&
> >> - (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) ||
> >> - intel_pipe_has_type(crtc, INTEL_OUTPUT_EDP))) {
> >> - I915_WRITE(PF_CTL(crtc->pipe), 0);
> >> - I915_WRITE(PF_WIN_POS(crtc->pipe), 0);
> >> - I915_WRITE(PF_WIN_SZ(crtc->pipe), 0);
> >> + ((pipe_config->pipe_src_w - 1) << 16) |
> >> + (pipe_config->pipe_src_h - 1));
> >> +
> >> + /* on skylake this is done by detaching scalers */
> >> + if (INTEL_INFO(dev)->gen == 9) {
> >> + skl_detach_scalers(crtc);
> >> +
> >> + if (pipe_config->pch_pfit.enabled)
> >> + skylake_pfit_enable(crtc);
> >> + }
> >> + else if (INTEL_INFO(dev)->gen < 9 &&
> >> + HAS_PCH_SPLIT(dev)) {
> >> + if (pipe_config->pch_pfit.enabled)
> >> + ironlake_pfit_enable(crtc);
> >> + else if (old_crtc_state->pch_pfit.enabled)
> >> + ironlake_pfit_disable(crtc, true);
> > Iirc Jesse's experiments showed that you could only disable the pfit
> > without a modeset, but not enable it without a modeset. Not sure how that
> > works on skl, but that's what I remember for ealier platforms at least.
> Is that really the case, or because of the power domain updates? Which, come to think of it, I don't
> handle correctly in this patch. :/
>
> intel_ddi_enable_transcoder_func seems to have a special case for haswell on eDP with panel fitter on/off.
> So perhaps disallow off -> on with haswell.
>
> Broadwell might not be able to change panel fitter from on to off, because of cdclk calculations:
> broadwell_modeset_calc_cdclk -> ilk_max_pixel_rate -> ilk_pipe_pixel_rate
>
> Those reasons might be contributing to failures.
>
> > Also it should work the same for gmch platforms really.
> Probably, but I wasn't able to test it and current code didn't seem to handle it.
>
> > Also big thing still missing is the special testcase which does direct
> > modesets trying to force fastset pfit changes on edp/dsi/lvds.
> Indeed! What should I expect on failure, and how do I define success?
One part is just exercising the code, i.e. do various modesets from
different modes to other modes to cover all the cases:
- off->on
- on->off
- on->on but chaning upscaling.
That would be really good already. Bonus points if you bother with an
atomic version which checks that it's indeed done in one vblank (using
timestamps and clearing the ALLOW_MODESET flag). But imo that's overkill.
Most of the correctness prove should be possible by catching pipe
underruns when we screw it up somehow.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 6/6] drm/i915: skip modeset if compatible for everyone.
2015-07-21 11:28 [PATCH 0/6] drm/i915: Fastboot for everyone! Maarten Lankhorst
` (4 preceding siblings ...)
2015-07-21 11:29 ` [PATCH 5/6] drm/i915: Make updating pipe without modeset atomic Maarten Lankhorst
@ 2015-07-21 11:29 ` Maarten Lankhorst
5 siblings, 0 replies; 15+ messages in thread
From: Maarten Lankhorst @ 2015-07-21 11:29 UTC (permalink / raw)
To: intel-gfx
This is done as a separate commit, to make it easier to revert
when things break.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 1 -
drivers/gpu/drm/i915/i915_params.c | 5 -----
drivers/gpu/drm/i915/intel_display.c | 3 +--
3 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 01fbdc57462a..09f6bab10698 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2604,7 +2604,6 @@ struct i915_params {
int enable_cmd_parser;
/* leave bools at the end to not create holes */
bool enable_hangcheck;
- bool fastboot;
bool prefault_disable;
bool load_detect_test;
bool reset;
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 5f4e7295295f..72439773f2df 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -40,7 +40,6 @@ struct i915_params i915 __read_mostly = {
.preliminary_hw_support = IS_ENABLED(CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT),
.disable_power_well = 1,
.enable_ips = 1,
- .fastboot = 0,
.prefault_disable = 0,
.load_detect_test = 0,
.reset = true,
@@ -130,10 +129,6 @@ MODULE_PARM_DESC(disable_power_well,
module_param_named(enable_ips, i915.enable_ips, int, 0600);
MODULE_PARM_DESC(enable_ips, "Enable IPS (default: true)");
-module_param_named(fastboot, i915.fastboot, bool, 0600);
-MODULE_PARM_DESC(fastboot,
- "Try to skip unnecessary mode sets at boot time (default: false)");
-
module_param_named_unsafe(prefault_disable, i915.prefault_disable, bool, 0600);
MODULE_PARM_DESC(prefault_disable,
"Disable page prefaulting for pread/pwrite/reloc (default:false). "
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 480b2336c7ba..82da2c54bd2e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -12969,8 +12969,7 @@ static int intel_atomic_check(struct drm_device *dev,
if (ret)
return ret;
- if (i915.fastboot &&
- intel_pipe_config_compare(state->dev,
+ if (intel_pipe_config_compare(state->dev,
to_intel_crtc_state(crtc->state),
pipe_config, true)) {
crtc_state->mode_changed = false;
--
2.1.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 15+ messages in thread