From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f193.google.com ([209.85.216.193]:37887 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbeHWUAQ (ORCPT ); Thu, 23 Aug 2018 16:00:16 -0400 Received: by mail-qt0-f193.google.com with SMTP id n6-v6so6940511qtl.4 for ; Thu, 23 Aug 2018 09:29:46 -0700 (PDT) Message-ID: <6f99abb8f474f064588c64e29058db5c66acae13.camel@redhat.com> Subject: Re: [PATCH 1/5] drm/nouveau: Check backlight IDs are >= 0, not > 0 From: Lyude Paul Reply-To: lyude@redhat.com To: Karol Herbst Cc: nouveau , stable@vger.kernel.org, Jeffery Miller , Ben Skeggs , David Airlie , dri-devel , LKML Date: Thu, 23 Aug 2018 12:29:44 -0400 In-Reply-To: References: <20180823012151.20099-1-lyude@redhat.com> <20180823012151.20099-2-lyude@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On Thu, 2018-08-23 at 14:00 +0200, Karol Herbst wrote: > Patches 1-5 are Reviewed-by: Karol Herbst > > 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 wrote: > > Remember, ida IDs start at 0, not 1! > > > > Signed-off-by: Lyude Paul > > Cc: stable@vger.kernel.org > > Cc: Jeffery Miller > > Cc: Karol Herbst > > --- > > 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 > >