* Re: [v4.3/-fixes PATCH/BACKPORT 0/4] plane related backports to -fixes
2015-10-14 9:06 [v4.3/-fixes PATCH/BACKPORT 0/4] plane related backports to -fixes Jani Nikula
@ 2015-10-14 9:06 ` Maarten Lankhorst
2015-10-14 12:19 ` Jani Nikula
2015-10-14 9:06 ` [v4.3/-fixes PATCH/BACKPORT 1/4] Revert "drm/i915: Add primary plane to mask if it's visible" Jani Nikula
` (3 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Maarten Lankhorst @ 2015-10-14 9:06 UTC (permalink / raw)
To: Jani Nikula, intel-gfx; +Cc: Joseph Yasi
Op 14-10-15 om 11:06 schreef Jani Nikula:
> I'm proposing to backport these to v4.3/-fixes, objections or acks?
>
> BR,
> Jani.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=91910#c4
>
>
> Jani Nikula (1):
> Revert "drm/i915: Add primary plane to mask if it's visible"
>
> Maarten Lankhorst (1):
> drm/i915: Add primary plane to mask if it's visible
>
> Ville Syrjälä (2):
> drm/i915: Assign hwmode after encoder state readout
> drm/i915: Move sprite/cursor plane disable to intel_sanitize_crtc()
>
> drivers/gpu/drm/i915/intel_display.c | 106 +++++++++++++++++------------------
> 1 file changed, 53 insertions(+), 53 deletions(-)
>
Acking all.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [v4.3/-fixes PATCH/BACKPORT 0/4] plane related backports to -fixes
2015-10-14 9:06 ` Maarten Lankhorst
@ 2015-10-14 12:19 ` Jani Nikula
0 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2015-10-14 12:19 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx; +Cc: Joseph Yasi
On Wed, 14 Oct 2015, Maarten Lankhorst <maarten.lankhorst@linux.intel.com> wrote:
> Op 14-10-15 om 11:06 schreef Jani Nikula:
>> I'm proposing to backport these to v4.3/-fixes, objections or acks?
>>
>> BR,
>> Jani.
>>
>> References: https://bugs.freedesktop.org/show_bug.cgi?id=91910#c4
>>
>>
>> Jani Nikula (1):
>> Revert "drm/i915: Add primary plane to mask if it's visible"
>>
>> Maarten Lankhorst (1):
>> drm/i915: Add primary plane to mask if it's visible
>>
>> Ville Syrjälä (2):
>> drm/i915: Assign hwmode after encoder state readout
>> drm/i915: Move sprite/cursor plane disable to intel_sanitize_crtc()
>>
>> drivers/gpu/drm/i915/intel_display.c | 106 +++++++++++++++++------------------
>> 1 file changed, 53 insertions(+), 53 deletions(-)
>>
> Acking all.
Thanks, pushed all to drm-intel-fixes.
BR,
Jani.
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* [v4.3/-fixes PATCH/BACKPORT 1/4] Revert "drm/i915: Add primary plane to mask if it's visible"
2015-10-14 9:06 [v4.3/-fixes PATCH/BACKPORT 0/4] plane related backports to -fixes Jani Nikula
2015-10-14 9:06 ` Maarten Lankhorst
@ 2015-10-14 9:06 ` Jani Nikula
2015-10-14 9:06 ` [v4.3/-fixes PATCH/BACKPORT 2/4] drm/i915: Assign hwmode after encoder state readout Jani Nikula
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2015-10-14 9:06 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula, Joseph Yasi
This reverts commit 721a09f7393de6c28a07516dccd654c6e995944a.
There is nothing wrong with the commit per se. We had two versions of
the commit, one in -next headed for v4.4 and this one for v4.3. Turns
out we'll need to backport more fixes from -next, and they conflict with
the v4.3 version. It gets messy. It will be easiest to revert this one,
and backport all the relevant commits from -next without modifications;
they apply cleanly after this revert.
Requested-by: Joseph Yasi <joe.yasi@gmail.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=91910#c4
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 2bf248b04542..7704315e067f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -15101,12 +15101,9 @@ static void readout_plane_state(struct intel_crtc *crtc,
plane_state = to_intel_plane_state(p->base.state);
- if (p->base.type == DRM_PLANE_TYPE_PRIMARY) {
+ if (p->base.type == DRM_PLANE_TYPE_PRIMARY)
plane_state->visible = primary_get_hw_state(crtc);
- if (plane_state->visible)
- crtc->base.state->plane_mask |=
- 1 << drm_plane_index(&p->base);
- } else {
+ else {
if (active)
p->disable_plane(&p->base, &crtc->base);
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread* [v4.3/-fixes PATCH/BACKPORT 2/4] drm/i915: Assign hwmode after encoder state readout
2015-10-14 9:06 [v4.3/-fixes PATCH/BACKPORT 0/4] plane related backports to -fixes Jani Nikula
2015-10-14 9:06 ` Maarten Lankhorst
2015-10-14 9:06 ` [v4.3/-fixes PATCH/BACKPORT 1/4] Revert "drm/i915: Add primary plane to mask if it's visible" Jani Nikula
@ 2015-10-14 9:06 ` Jani Nikula
2015-10-14 9:06 ` [v4.3/-fixes PATCH/BACKPORT 3/4] drm/i915: Move sprite/cursor plane disable to intel_sanitize_crtc() Jani Nikula
2015-10-14 9:06 ` [v4.3/-fixes PATCH/BACKPORT 4/4] drm/i915: Add primary plane to mask if it's visible Jani Nikula
4 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2015-10-14 9:06 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula, Joseph Yasi
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
The dotclock is often calculated in encoder .get_config(), so we
shouldn't copy the adjusted_mode to hwmode until we have read out the
dotclock.
Gets rid of some warnings like these:
[drm:drm_calc_timestamping_constants [drm]] *ERROR* crtc 21: Can't calculate constants, dotclock = 0!
[drm:i915_get_vblank_timestamp] crtc 0 is disabled
v2: Steal Maarten's idea to move crtc->mode etc. assignment too
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91428
Reviewed-by: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 57 +++++++++++++++++++-----------------
1 file changed, 30 insertions(+), 27 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 7704315e067f..ed87a7e4c32a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -15132,33 +15132,6 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
crtc->base.state->active = crtc->active;
crtc->base.enabled = crtc->active;
- memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));
- if (crtc->base.state->active) {
- intel_mode_from_pipe_config(&crtc->base.mode, crtc->config);
- intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config);
- WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));
-
- /*
- * The initial mode needs to be set in order to keep
- * the atomic core happy. It wants a valid mode if the
- * crtc's enabled, so we do the above call.
- *
- * At this point some state updated by the connectors
- * in their ->detect() callback has not run yet, so
- * no recalculation can be done yet.
- *
- * Even if we could do a recalculation and modeset
- * right now it would cause a double modeset if
- * fbdev or userspace chooses a different initial mode.
- *
- * If that happens, someone indicated they wanted a
- * mode change, which means it's safe to do a full
- * recalculation.
- */
- crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED;
- }
-
- crtc->base.hwmode = crtc->config->base.adjusted_mode;
readout_plane_state(crtc, to_intel_crtc_state(crtc->base.state));
DRM_DEBUG_KMS("[CRTC:%d] hw state readout: %s\n",
@@ -15218,6 +15191,36 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
connector->base.name,
connector->base.encoder ? "enabled" : "disabled");
}
+
+ for_each_intel_crtc(dev, crtc) {
+ crtc->base.hwmode = crtc->config->base.adjusted_mode;
+
+ memset(&crtc->base.mode, 0, sizeof(crtc->base.mode));
+ if (crtc->base.state->active) {
+ intel_mode_from_pipe_config(&crtc->base.mode, crtc->config);
+ intel_mode_from_pipe_config(&crtc->base.state->adjusted_mode, crtc->config);
+ WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, &crtc->base.mode));
+
+ /*
+ * The initial mode needs to be set in order to keep
+ * the atomic core happy. It wants a valid mode if the
+ * crtc's enabled, so we do the above call.
+ *
+ * At this point some state updated by the connectors
+ * in their ->detect() callback has not run yet, so
+ * no recalculation can be done yet.
+ *
+ * Even if we could do a recalculation and modeset
+ * right now it would cause a double modeset if
+ * fbdev or userspace chooses a different initial mode.
+ *
+ * If that happens, someone indicated they wanted a
+ * mode change, which means it's safe to do a full
+ * recalculation.
+ */
+ crtc->base.state->mode.private_flags = I915_MODE_FLAG_INHERITED;
+ }
+ }
}
/* Scan out the current hw modeset state,
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread* [v4.3/-fixes PATCH/BACKPORT 3/4] drm/i915: Move sprite/cursor plane disable to intel_sanitize_crtc()
2015-10-14 9:06 [v4.3/-fixes PATCH/BACKPORT 0/4] plane related backports to -fixes Jani Nikula
` (2 preceding siblings ...)
2015-10-14 9:06 ` [v4.3/-fixes PATCH/BACKPORT 2/4] drm/i915: Assign hwmode after encoder state readout Jani Nikula
@ 2015-10-14 9:06 ` Jani Nikula
2015-10-14 9:06 ` [v4.3/-fixes PATCH/BACKPORT 4/4] drm/i915: Add primary plane to mask if it's visible Jani Nikula
4 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2015-10-14 9:06 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula, Joseph Yasi
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Move the sprite/cursor plane disabling to occur in intel_sanitize_crtc()
where it belongs instead of doing it in intel_modeset_readout_hw_state().
The plane disabling was first added in
4cf0ebbd4fafbdf8e6431dbb315e5511c3efdc3b drm/i915: Rework plane readout.
I got the idea from some patches from Partik and/or Maarten but those
moved also the plane state readout to intel_sanitize_crtc() which isn't
quite right in my opinion.
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
References: https://bugs.freedesktop.org/show_bug.cgi?id=91910
Reviewed-by: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 44 ++++++++++++++++--------------------
1 file changed, 20 insertions(+), 24 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ed87a7e4c32a..ac407e3e1edd 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14911,9 +14911,19 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
/* restore vblank interrupts to correct state */
drm_crtc_vblank_reset(&crtc->base);
if (crtc->active) {
+ struct intel_plane *plane;
+
drm_calc_timestamping_constants(&crtc->base, &crtc->base.hwmode);
update_scanline_offset(crtc);
drm_crtc_vblank_on(&crtc->base);
+
+ /* Disable everything but the primary plane */
+ for_each_intel_plane_on_crtc(dev, crtc, plane) {
+ if (plane->base.type == DRM_PLANE_TYPE_PRIMARY)
+ continue;
+
+ plane->disable_plane(&plane->base, &crtc->base);
+ }
}
/* We need to sanitize the plane -> pipe mapping first because this will
@@ -15081,35 +15091,21 @@ void i915_redisable_vga(struct drm_device *dev)
i915_redisable_vga_power_on(dev);
}
-static bool primary_get_hw_state(struct intel_crtc *crtc)
+static bool primary_get_hw_state(struct intel_plane *plane)
{
- struct drm_i915_private *dev_priv = crtc->base.dev->dev_private;
+ struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
- return !!(I915_READ(DSPCNTR(crtc->plane)) & DISPLAY_PLANE_ENABLE);
+ return I915_READ(DSPCNTR(plane->plane)) & DISPLAY_PLANE_ENABLE;
}
-static void readout_plane_state(struct intel_crtc *crtc,
- struct intel_crtc_state *crtc_state)
+/* FIXME read out full plane state for all planes */
+static void readout_plane_state(struct intel_crtc *crtc)
{
- struct intel_plane *p;
- struct intel_plane_state *plane_state;
- bool active = crtc_state->base.active;
+ struct intel_plane_state *plane_state =
+ to_intel_plane_state(crtc->base.primary->state);
- for_each_intel_plane(crtc->base.dev, p) {
- if (crtc->pipe != p->pipe)
- continue;
-
- plane_state = to_intel_plane_state(p->base.state);
-
- if (p->base.type == DRM_PLANE_TYPE_PRIMARY)
- plane_state->visible = primary_get_hw_state(crtc);
- else {
- if (active)
- p->disable_plane(&p->base, &crtc->base);
-
- plane_state->visible = false;
- }
- }
+ plane_state->visible =
+ primary_get_hw_state(to_intel_plane(crtc->base.primary));
}
static void intel_modeset_readout_hw_state(struct drm_device *dev)
@@ -15132,7 +15128,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
crtc->base.state->active = crtc->active;
crtc->base.enabled = crtc->active;
- readout_plane_state(crtc, to_intel_crtc_state(crtc->base.state));
+ readout_plane_state(crtc);
DRM_DEBUG_KMS("[CRTC:%d] hw state readout: %s\n",
crtc->base.base.id,
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread* [v4.3/-fixes PATCH/BACKPORT 4/4] drm/i915: Add primary plane to mask if it's visible
2015-10-14 9:06 [v4.3/-fixes PATCH/BACKPORT 0/4] plane related backports to -fixes Jani Nikula
` (3 preceding siblings ...)
2015-10-14 9:06 ` [v4.3/-fixes PATCH/BACKPORT 3/4] drm/i915: Move sprite/cursor plane disable to intel_sanitize_crtc() Jani Nikula
@ 2015-10-14 9:06 ` Jani Nikula
4 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2015-10-14 9:06 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula, Joseph Yasi
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
This fixes the warnings like
"plane A assertion failure, should be disabled but not"
that on the initial modeset during boot. This can happen if
the primary plane is enabled by the firmware, but inheriting
it fails because the DMAR is active or for other reasons.
Most likely caused by
commit 36750f284b3a4f19b304fda1bb7d6e9e1275ea8d
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date: Mon Jun 1 12:49:54 2015 +0200
drm/i915: update plane state during init
This is a new version of
commit 721a09f7393de6c28a07516dccd654c6e995944a
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date: Tue Sep 15 14:28:54 2015 +0200
drm/i915: Add primary plane to mask if it's visible
That was reverted.
Reported-by: Andreas Reis <andreas.reis@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91429
Reported-and-tested-by: Emil Renner Berthing <kernel@esmil.dk>
Tested-by: Andreas Reis <andreas.reis@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index ac407e3e1edd..b2270d576979 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -15101,11 +15101,15 @@ static bool primary_get_hw_state(struct intel_plane *plane)
/* FIXME read out full plane state for all planes */
static void readout_plane_state(struct intel_crtc *crtc)
{
+ struct drm_plane *primary = crtc->base.primary;
struct intel_plane_state *plane_state =
- to_intel_plane_state(crtc->base.primary->state);
+ to_intel_plane_state(primary->state);
plane_state->visible =
- primary_get_hw_state(to_intel_plane(crtc->base.primary));
+ primary_get_hw_state(to_intel_plane(primary));
+
+ if (plane_state->visible)
+ crtc->base.state->plane_mask |= 1 << drm_plane_index(primary);
}
static void intel_modeset_readout_hw_state(struct drm_device *dev)
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread