All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jyri Sarha <jsarha@ti.com>
To: dri-devel@lists.freedesktop.org, mk+kernel@arm.linux.org.uk
Cc: Liviu.Dudau@arm.com
Subject: Re: [PATCH] drm/i2c: tda998x: Choose between atomic or non atomic dpms helper
Date: Thu, 25 Feb 2016 12:09:39 +0200	[thread overview]
Message-ID: <56CED2E3.3010401@ti.com> (raw)
In-Reply-To: <1452975474-17058-1-git-send-email-jsarha@ti.com>

Hi,
Based on discussion around this patch:

https://lists.freedesktop.org/archives/dri-devel/2016-February/100685.html

I think the patch below should be applied to tda988x development branch. 
Would you take it or do you prefer some other approach?

Best regards,
Jyri

On 01/16/16 22:17, Jyri Sarha wrote:
> Choose between atomic or non atomic connector dpms helper. If tda998x
> is connected to a drm driver that does not support atomic modeset
> calling drm_atomic_helper_connector_dpms() causes a crash when the
> connectors atomic state is not initialized. The patch implements a
> driver specific connector dpms helper that calls
> drm_atomic_helper_connector_dpms() if driver supports DRIVER_ATOMIC
> and otherwise it calls the legacy drm_helper_connector_dpms().
>
> Fixes commit 9736e988d328 ("drm/i2c: tda998x: Add support for atomic
> modesetting").
>
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>
> Ok, so this is the second approach to solve this issue. The first
> attempt can be found here [1] with the follow from Liviu Dudau that
> suggested this approach.
>
> It just makes me wonder if drm_atomic_helper_connector_dpms() should
> call the legacy callback automatically if DRIVER_ATOMIC is not set or
> at least bail out gracefully with an error message. Then again it may
> be overkill if the tda998x is the only driver that need to support
> both situations.
>
> Best regards,
> Jyri
>
> [1] http://www.spinics.net/lists/dri-devel/msg98514.html
>
>   drivers/gpu/drm/i2c/tda998x_drv.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
> index 012d36d..bb7d507 100644
> --- a/drivers/gpu/drm/i2c/tda998x_drv.c
> +++ b/drivers/gpu/drm/i2c/tda998x_drv.c
> @@ -1382,8 +1382,16 @@ static void tda998x_connector_destroy(struct drm_connector *connector)
>   	drm_connector_cleanup(connector);
>   }
>
> +static int tda998x_connector_dpms(struct drm_connector *connector, int mode)
> +{
> +	if (drm_core_check_feature(connector->dev, DRIVER_ATOMIC))
> +		return drm_atomic_helper_connector_dpms(connector, mode);
> +	else
> +		return drm_helper_connector_dpms(connector, mode);
> +}
> +
>   static const struct drm_connector_funcs tda998x_connector_funcs = {
> -	.dpms = drm_atomic_helper_connector_dpms,
> +	.dpms = tda998x_connector_dpms,
>   	.reset = drm_atomic_helper_connector_reset,
>   	.fill_modes = drm_helper_probe_single_connector_modes,
>   	.detect = tda998x_connector_detect,
>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-02-25 10:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-16 20:17 [PATCH] drm/i2c: tda998x: Choose between atomic or non atomic dpms helper Jyri Sarha
2016-01-18  9:52 ` Liviu.Dudau
2016-01-18 11:15   ` Russell King - ARM Linux
2016-02-25 10:09 ` Jyri Sarha [this message]
2016-02-25 10:20   ` Liviu.Dudau
2016-03-07 21:47 ` Jyri Sarha
2016-03-08  1:16   ` Dave Airlie

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=56CED2E3.3010401@ti.com \
    --to=jsarha@ti.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mk+kernel@arm.linux.org.uk \
    /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.