All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: ville.syrjala@intel.com, daniel.vetter@ffwll.ch,
	lakshminarayana.vudum@intel.com, dri-devel@lists.freedesktop.org,
	martin.peres@intel.com, juha-pekka.heikkila@intel.com
Subject: Re: [PATCH v1] drm: Do not allow to set NOFB for active primary plane
Date: Mon, 15 Apr 2019 15:36:08 +0300	[thread overview]
Message-ID: <20190415123608.GO3888@intel.com> (raw)
In-Reply-To: <20190415075847.16483-1-stanislav.lisovskiy@intel.com>

On Mon, Apr 15, 2019 at 10:58:47AM +0300, Stanislav Lisovskiy wrote:
> There was an issue reported from end users, confirmed
> also locally that when user executes xrandr --output <some DP>
> --rotate left/right, the other eDP screen gets blank after rotation.
> 
> Investigation showed that reason was that primary plane
> was that screen was for some reason disabled, while cursor
> plane was still enabled.
> After some effort it turns out that userspace might wrongly
> assign NOFB to active primary plane for some reason.
> 
> Then this gets detected in drm_atomic_helper_check_plane_state,
> called from ->plane_check and plane gets deactivated, leaving
> the screen blank and cursor visible. This can be cured by reboot
> or xrandr off/on sequence for that crtc.
> 
> This patch is proposal to fix the issue by forbiding fb removal
> from active primary plane. If one needs to remove fb plane must be
> disabled first.
> 
> Not sure if this is correct, however it fixes the issue at least.

It is not. Removing the fb (and crtc) is how you disable a plane.

> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110375
> Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
> ---
>  drivers/gpu/drm/drm_atomic_uapi.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index ea797d4c82ee..e2f078b302f3 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -229,6 +229,15 @@ drm_atomic_set_fb_for_plane(struct drm_plane_state *plane_state,
>  {
>  	struct drm_plane *plane = plane_state->plane;
>  
> +	if (!fb) {
> +		if (plane->state->visible && plane->type == DRM_PLANE_TYPE_PRIMARY) {a

.visible is not even computed yet when this is called.

> +			DRM_DEBUG_ATOMIC("Not allowed to set [NOFB] for active"
> +					" primary [PLANE:%d:%s] - disable first",
> +					plane->base.id, plane->name);
> +			return;
> +		}
> +	}
> +
>  	if (fb)
>  		DRM_DEBUG_ATOMIC("Set [FB:%d] for [PLANE:%d:%s] state %p\n",
>  				 fb->base.id, plane->base.id, plane->name,
> -- 
> 2.17.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-04-15 12:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15  7:58 [PATCH v1] drm: Do not allow to set NOFB for active primary plane Stanislav Lisovskiy
2019-04-15 12:36 ` Ville Syrjälä [this message]
2019-04-15 12:41   ` Lisovskiy, Stanislav
2019-04-15 16:14     ` Daniel Vetter
2019-04-15  8:00 Stanislav Lisovskiy
2019-04-15 10:40 ` Maarten Lankhorst
2019-04-15 11:27   ` Lisovskiy, Stanislav
2019-04-16  7:38     ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190415123608.GO3888@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=juha-pekka.heikkila@intel.com \
    --cc=lakshminarayana.vudum@intel.com \
    --cc=martin.peres@intel.com \
    --cc=stanislav.lisovskiy@intel.com \
    --cc=ville.syrjala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.