Thierry Reding
2014-Mar-24 22:58 UTC
[Nouveau] [PATCH 08/12] drm/nouveau/graph: enable when using external firmware
On Mon, Mar 24, 2014 at 05:42:30PM +0900, Alexandre Courbot wrote: [...]> diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c > index 6ef8bf181b2d..f997a18f5760 100644 > --- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c > +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c > @@ -1133,10 +1133,14 @@ nvc0_graph_ctor(struct nouveau_object *parent, struct nouveau_object *engine, > struct nvc0_graph_oclass *oclass = (void *)bclass; > struct nouveau_device *device = nv_device(parent); > struct nvc0_graph_priv *priv; > + bool use_fw;Perhaps "ext_fw" or "use_ext_fw" would be more accurate.> int ret, i; > > + use_fw = nouveau_boolopt(device->cfgopt, "NvGrUseFW", false); > + > ret = nouveau_graph_create(parent, engine, bclass, > - (oclass->fecs.ucode != NULL), &priv); > + (oclass->fecs.ucode != NULL) || use_fw, > + &priv);Or perhaps a more intuitive way would be to name the variable "enable" and have something like: if (!nouveau_boolopt(device->cfgopt, "NvGrUseFW", false)) enable = oclass->fecs.ucode != NULL; else enable = true; ret = nouveau_graph_create(parent, engine, bclass, enable, &priv); ... Thierry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/nouveau/attachments/20140324/8d29e34e/attachment.sig>
Ben Skeggs
2014-Mar-26 04:21 UTC
[Nouveau] [PATCH 08/12] drm/nouveau/graph: enable when using external firmware
On Tue, Mar 25, 2014 at 8:58 AM, Thierry Reding <thierry.reding at gmail.com> wrote:> On Mon, Mar 24, 2014 at 05:42:30PM +0900, Alexandre Courbot wrote: > [...] >> diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c >> index 6ef8bf181b2d..f997a18f5760 100644 >> --- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c >> +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c >> @@ -1133,10 +1133,14 @@ nvc0_graph_ctor(struct nouveau_object *parent, struct nouveau_object *engine, >> struct nvc0_graph_oclass *oclass = (void *)bclass; >> struct nouveau_device *device = nv_device(parent); >> struct nvc0_graph_priv *priv; >> + bool use_fw; > > Perhaps "ext_fw" or "use_ext_fw" would be more accurate. > >> int ret, i; >> >> + use_fw = nouveau_boolopt(device->cfgopt, "NvGrUseFW", false); >> + >> ret = nouveau_graph_create(parent, engine, bclass, >> - (oclass->fecs.ucode != NULL), &priv); >> + (oclass->fecs.ucode != NULL) || use_fw, >> + &priv); > > Or perhaps a more intuitive way would be to name the variable "enable" > and have something like: > > if (!nouveau_boolopt(device->cfgopt, "NvGrUseFW", false)) > enable = oclass->fecs.ucode != NULL; > else > enable = true; > > ret = nouveau_graph_create(parent, engine, bclass, enable, &priv); > ...Agreed, this looks a lot nicer.> > Thierry > > _______________________________________________ > dri-devel mailing list > dri-devel at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel >
Alexandre Courbot
2014-Apr-02 13:53 UTC
[Nouveau] [PATCH 08/12] drm/nouveau/graph: enable when using external firmware
On Wed, Mar 26, 2014 at 1:21 PM, Ben Skeggs <skeggsb at gmail.com> wrote:> On Tue, Mar 25, 2014 at 8:58 AM, Thierry Reding > <thierry.reding at gmail.com> wrote: >> On Mon, Mar 24, 2014 at 05:42:30PM +0900, Alexandre Courbot wrote: >> [...] >>> diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c >>> index 6ef8bf181b2d..f997a18f5760 100644 >>> --- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c >>> +++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c >>> @@ -1133,10 +1133,14 @@ nvc0_graph_ctor(struct nouveau_object *parent, struct nouveau_object *engine, >>> struct nvc0_graph_oclass *oclass = (void *)bclass; >>> struct nouveau_device *device = nv_device(parent); >>> struct nvc0_graph_priv *priv; >>> + bool use_fw; >> >> Perhaps "ext_fw" or "use_ext_fw" would be more accurate. >> >>> int ret, i; >>> >>> + use_fw = nouveau_boolopt(device->cfgopt, "NvGrUseFW", false); >>> + >>> ret = nouveau_graph_create(parent, engine, bclass, >>> - (oclass->fecs.ucode != NULL), &priv); >>> + (oclass->fecs.ucode != NULL) || use_fw, >>> + &priv); >> >> Or perhaps a more intuitive way would be to name the variable "enable" >> and have something like: >> >> if (!nouveau_boolopt(device->cfgopt, "NvGrUseFW", false)) >> enable = oclass->fecs.ucode != NULL; >> else >> enable = true; >> >> ret = nouveau_graph_create(parent, engine, bclass, enable, &priv); >> ... > Agreed, this looks a lot nicer.Will fix that, thanks!
Maybe Matching Threads
- [PATCH 08/12] drm/nouveau/graph: enable when using external firmware
- [PATCH 08/12] drm/nouveau/graph: enable when using external firmware
- [PATCH v3 6/9] drm/nouveau/graph: enable when using external firmware
- [PATCH v3 6/9] drm/nouveau/graph: enable when using external firmware
- [PATCH 00/12] drm/nouveau: support for GK20A, cont'd