Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: narmstrong@baylibre.com (Neil Armstrong)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/8] drm/sun4i: backend: Allow a NULL plane pointer to retrieve the format
Date: Wed, 13 Dec 2017 17:03:39 +0100	[thread overview]
Message-ID: <b9211879-d724-fb3c-25a7-cf7f5c50e431@baylibre.com> (raw)
In-Reply-To: <6a1686760e61baa9f21fd2f12e56a8de92eb1714.1513178989.git-series.maxime.ripard@free-electrons.com>

On 13/12/2017 16:33, Maxime Ripard wrote:
> The function converting the DRM format to its equivalent in the backend
> registers was assuming that we were having a plane.
> 
> However, we might want to use that function when setting up a plane using
> the frontend, in which case we will not have a plane associated to the
> backend's layer. Yet, we still need to setup the format to the one output
> by the frontend.
> 
> Test for NULL plane pointers before referencing them, so that we can work
> around it.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  drivers/gpu/drm/sun4i/sun4i_backend.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c
> index c99d1a7e815a..f971d3fb5ee4 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_backend.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c
> @@ -93,7 +93,7 @@ void sun4i_backend_layer_enable(struct sun4i_backend *backend,
>  static int sun4i_backend_drm_format_to_layer(struct drm_plane *plane,
>  					     u32 format, u32 *mode)
>  {
> -	if ((plane->type == DRM_PLANE_TYPE_PRIMARY) &&
> +	if (plane && (plane->type == DRM_PLANE_TYPE_PRIMARY) &&
>  	    (format == DRM_FORMAT_ARGB8888))
>  		format = DRM_FORMAT_XRGB8888;
>  
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

  reply	other threads:[~2017-12-13 16:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1513181781-0808628882.0a9bc10eb7@prakkezator.vehosting.nl>
2017-12-13 15:33 ` [PATCH 0/8] drm/sun4i: Support the Display Engine frontend Maxime Ripard
2017-12-13 15:33   ` [PATCH 1/8] drm/sun4i: backend: Move line stride setup to buffer setup function Maxime Ripard
2017-12-13 16:03     ` Neil Armstrong
2017-12-13 15:33   ` [PATCH 2/8] drm/sun4i: backend: Allow a NULL plane pointer to retrieve the format Maxime Ripard
2017-12-13 16:03     ` Neil Armstrong [this message]
2017-12-13 15:33   ` [PATCH 3/8] drm/sun4i: sun4i_layer: Add a custom plane state Maxime Ripard
2017-12-13 16:05     ` Neil Armstrong
2017-12-13 15:33   ` [PATCH 4/8] drm/sun4i: crtc: Add a custom crtc atomic_check Maxime Ripard
2017-12-13 16:06     ` Neil Armstrong
2017-12-13 15:33   ` [PATCH 5/8] drm/sun4i: Add a driver for the display frontend Maxime Ripard
2017-12-13 16:10     ` Neil Armstrong
2017-12-16  7:00     ` kbuild test robot
2017-12-13 15:33   ` [PATCH 6/8] drm/sun4i: sun4i_layer: Wire in the frontend Maxime Ripard
2017-12-13 16:11     ` Neil Armstrong
2017-12-13 16:23     ` Thomas van Kleef
2017-12-14 10:32       ` Maxime Ripard
2017-12-16  9:17     ` kbuild test robot
2017-12-13 15:33   ` [PATCH 7/8] drm/sun4i: sun4i_layer: Add a custom atomic_check for " Maxime Ripard
2017-12-13 16:12     ` Neil Armstrong
2017-12-13 15:33   ` [PATCH 8/8] ARM: dts: sun8i: a33 Enable our display frontend Maxime Ripard
2017-12-13 16:16   ` [PATCH 0/8] drm/sun4i: Support the Display Engine frontend Thomas van Kleef
2017-12-14  8:35     ` Maxime Ripard

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=b9211879-d724-fb3c-25a7-cf7f5c50e431@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox