stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] drm/nouveau: Check backlight IDs are >= 0, not > 0
       [not found] <20180823012151.20099-1-lyude@redhat.com>
@ 2018-08-23  1:21 ` Lyude Paul
  2018-08-23 12:00   ` Karol Herbst
  0 siblings, 1 reply; 3+ messages in thread
From: Lyude Paul @ 2018-08-23  1:21 UTC (permalink / raw)
  To: nouveau
  Cc: stable, Jeffery Miller, Karol Herbst, Ben Skeggs, David Airlie,
	dri-devel, linux-kernel

Remember, ida IDs start at 0, not 1!

Signed-off-by: Lyude Paul <lyude@redhat.com>
Cc: stable@vger.kernel.org
Cc: Jeffery Miller <jmiller@neverware.com>
Cc: Karol Herbst <kherbst@redhat.com>
---
 drivers/gpu/drm/nouveau/nouveau_backlight.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index 408b955e5c39..6dd72bc32897 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -116,7 +116,7 @@ nv40_backlight_init(struct drm_connector *connector)
 				       &nv40_bl_ops, &props);
 
 	if (IS_ERR(bd)) {
-		if (bl_connector.id > 0)
+		if (bl_connector.id >= 0)
 			ida_simple_remove(&bl_ida, bl_connector.id);
 		return PTR_ERR(bd);
 	}
@@ -249,7 +249,7 @@ nv50_backlight_init(struct drm_connector *connector)
 				       nv_encoder, ops, &props);
 
 	if (IS_ERR(bd)) {
-		if (bl_connector.id > 0)
+		if (bl_connector.id >= 0)
 			ida_simple_remove(&bl_ida, bl_connector.id);
 		return PTR_ERR(bd);
 	}
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/5] drm/nouveau: Check backlight IDs are >= 0, not > 0
  2018-08-23  1:21 ` [PATCH 1/5] drm/nouveau: Check backlight IDs are >= 0, not > 0 Lyude Paul
@ 2018-08-23 12:00   ` Karol Herbst
  2018-08-23 16:29     ` Lyude Paul
  0 siblings, 1 reply; 3+ messages in thread
From: Karol Herbst @ 2018-08-23 12:00 UTC (permalink / raw)
  To: Lyude Paul
  Cc: nouveau, stable, Jeffery Miller, Ben Skeggs, David Airlie,
	dri-devel, LKML

Patches 1-5 are Reviewed-by: Karol Herbst <kherbst@redhat.com>

I think it might be worth to test those patches on a system without
any backlight devices just to verify we don't break things, but the
code looked good already, so maybe we don't really need to test.

On Thu, Aug 23, 2018 at 3:21 AM, Lyude Paul <lyude@redhat.com> wrote:
> Remember, ida IDs start at 0, not 1!
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> Cc: stable@vger.kernel.org
> Cc: Jeffery Miller <jmiller@neverware.com>
> Cc: Karol Herbst <kherbst@redhat.com>
> ---
>  drivers/gpu/drm/nouveau/nouveau_backlight.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> index 408b955e5c39..6dd72bc32897 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> @@ -116,7 +116,7 @@ nv40_backlight_init(struct drm_connector *connector)
>                                        &nv40_bl_ops, &props);
>
>         if (IS_ERR(bd)) {
> -               if (bl_connector.id > 0)
> +               if (bl_connector.id >= 0)
>                         ida_simple_remove(&bl_ida, bl_connector.id);
>                 return PTR_ERR(bd);
>         }
> @@ -249,7 +249,7 @@ nv50_backlight_init(struct drm_connector *connector)
>                                        nv_encoder, ops, &props);
>
>         if (IS_ERR(bd)) {
> -               if (bl_connector.id > 0)
> +               if (bl_connector.id >= 0)
>                         ida_simple_remove(&bl_ida, bl_connector.id);
>                 return PTR_ERR(bd);
>         }
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/5] drm/nouveau: Check backlight IDs are >= 0, not > 0
  2018-08-23 12:00   ` Karol Herbst
@ 2018-08-23 16:29     ` Lyude Paul
  0 siblings, 0 replies; 3+ messages in thread
From: Lyude Paul @ 2018-08-23 16:29 UTC (permalink / raw)
  To: Karol Herbst
  Cc: nouveau, stable, Jeffery Miller, Ben Skeggs, David Airlie,
	dri-devel, LKML

On Thu, 2018-08-23 at 14:00 +0200, Karol Herbst wrote:
> Patches 1-5 are Reviewed-by: Karol Herbst <kherbst@redhat.com>
> 
> I think it might be worth to test those patches on a system without
> any backlight devices just to verify we don't break things, but the
> code looked good already, so maybe we don't really need to test.
Did! The P50 lets you switch between dedicated GPU mode and hybrid GPU mode, and
it switches backlight control between the intel and nvidia GPUs. Seemed to work
just fine for me
> 
> On Thu, Aug 23, 2018 at 3:21 AM, Lyude Paul <lyude@redhat.com> wrote:
> > Remember, ida IDs start at 0, not 1!
> > 
> > Signed-off-by: Lyude Paul <lyude@redhat.com>
> > Cc: stable@vger.kernel.org
> > Cc: Jeffery Miller <jmiller@neverware.com>
> > Cc: Karol Herbst <kherbst@redhat.com>
> > ---
> >  drivers/gpu/drm/nouveau/nouveau_backlight.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c
> > b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> > index 408b955e5c39..6dd72bc32897 100644
> > --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
> > +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> > @@ -116,7 +116,7 @@ nv40_backlight_init(struct drm_connector *connector)
> >                                        &nv40_bl_ops, &props);
> > 
> >         if (IS_ERR(bd)) {
> > -               if (bl_connector.id > 0)
> > +               if (bl_connector.id >= 0)
> >                         ida_simple_remove(&bl_ida, bl_connector.id);
> >                 return PTR_ERR(bd);
> >         }
> > @@ -249,7 +249,7 @@ nv50_backlight_init(struct drm_connector *connector)
> >                                        nv_encoder, ops, &props);
> > 
> >         if (IS_ERR(bd)) {
> > -               if (bl_connector.id > 0)
> > +               if (bl_connector.id >= 0)
> >                         ida_simple_remove(&bl_ida, bl_connector.id);
> >                 return PTR_ERR(bd);
> >         }
> > --
> > 2.17.1
> > 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-23 20:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180823012151.20099-1-lyude@redhat.com>
2018-08-23  1:21 ` [PATCH 1/5] drm/nouveau: Check backlight IDs are >= 0, not > 0 Lyude Paul
2018-08-23 12:00   ` Karol Herbst
2018-08-23 16:29     ` Lyude Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).