* [PATCH 1/3] drm/nouveau: remove duplicate copy of nv44_graph_class
@ 2013-07-29 23:05 Ilia Mirkin
[not found] ` <1375139118-17398-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Ilia Mirkin @ 2013-07-29 23:05 UTC (permalink / raw)
To: Ben Skeggs; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
---
drivers/gpu/drm/nouveau/core/engine/graph/nv40.h | 3 +++
drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c | 10 ++--------
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nv40.h b/drivers/gpu/drm/nouveau/core/engine/graph/nv40.h
index 7da35a4..ad82093 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nv40.h
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nv40.h
@@ -1,6 +1,9 @@
#ifndef __NV40_GRAPH_H__
#define __NV40_GRAPH_H__
+#include <core/device.h>
+#include <core/gpuobj.h>
+
/* returns 1 if device is one of the nv4x using the 0x4497 object class,
* helpful to determine a number of other hardware features
*/
diff --git a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c
index 716bf41..b10a143 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c
@@ -22,15 +22,9 @@
* Authors: Ben Skeggs
*/
-#include "nv04.h"
+#include <engine/graph/nv40.h>
-static inline int
-nv44_graph_class(struct nv04_instmem_priv *priv)
-{
- if ((nv_device(priv)->chipset & 0xf0) == 0x60)
- return 1;
- return !(0x0baf & (1 << (nv_device(priv)->chipset & 0x0f)));
-}
+#include "nv04.h"
static int
nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
--
1.8.1.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] drm/nv40/mpeg: write magic value to channel object to make it work
[not found] ` <1375139118-17398-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
@ 2013-07-29 23:05 ` Ilia Mirkin
2013-07-29 23:05 ` [PATCH 3/3] drm/nv31/mpeg: don't recognize nv3x cards as having nv44 graph class Ilia Mirkin
1 sibling, 0 replies; 5+ messages in thread
From: Ilia Mirkin @ 2013-07-29 23:05 UTC (permalink / raw)
To: Ben Skeggs; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Looks like the rewrite in commit ebb945a94b ("drm/nouveau: port all
engines to new engine module format") missed that one little detail.
Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
---
drivers/gpu/drm/nouveau/core/engine/mpeg/nv40.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv40.c b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv40.c
index f7c581a..5d39b5a 100644
--- a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv40.c
+++ b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv40.c
@@ -61,6 +61,8 @@ nv40_mpeg_context_ctor(struct nouveau_object *parent,
if (ret)
return ret;
+ nv_wo32(&chan->base.base, 0x78, 0x02001ec1);
+
return 0;
}
--
1.8.1.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] drm/nv31/mpeg: don't recognize nv3x cards as having nv44 graph class
[not found] ` <1375139118-17398-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2013-07-29 23:05 ` [PATCH 2/3] drm/nv40/mpeg: write magic value to channel object to make it work Ilia Mirkin
@ 2013-07-29 23:05 ` Ilia Mirkin
[not found] ` <1375139118-17398-3-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
1 sibling, 1 reply; 5+ messages in thread
From: Ilia Mirkin @ 2013-07-29 23:05 UTC (permalink / raw)
To: Ben Skeggs; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
---
drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
index 9f7c7d5..c190043 100644
--- a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
+++ b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
@@ -284,7 +284,10 @@ nv31_mpeg_init(struct nouveau_object *object)
/* PMPEG init */
nv_wr32(priv, 0x00b32c, 0x00000000);
nv_wr32(priv, 0x00b314, 0x00000100);
- nv_wr32(priv, 0x00b220, nv44_graph_class(priv) ? 0x00000044 : 0x00000031);
+ if (nv_device(priv)->chipset >= 0x40 && nv44_graph_class(priv))
+ nv_wr32(priv, 0x00b220, 0x00000044);
+ else
+ nv_wr32(priv, 0x00b220, 0x00000031);
nv_wr32(priv, 0x00b300, 0x02001ec1);
nv_mask(priv, 0x00b32c, 0x00000001, 0x00000001);
--
1.8.1.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 3/3] drm/nv31/mpeg: don't recognize nv3x cards as having nv44 graph class
[not found] ` <1375139118-17398-3-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
@ 2013-07-29 23:27 ` Emil Velikov
[not found] ` <51F6FA5A.3030703-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Emil Velikov @ 2013-07-29 23:27 UTC (permalink / raw)
To: Ilia Mirkin; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Ben Skeggs
On 30/07/13 00:05, Ilia Mirkin wrote:
> Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
> ---
> drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
> index 9f7c7d5..c190043 100644
> --- a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
> +++ b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
> @@ -284,7 +284,10 @@ nv31_mpeg_init(struct nouveau_object *object)
> /* PMPEG init */
> nv_wr32(priv, 0x00b32c, 0x00000000);
> nv_wr32(priv, 0x00b314, 0x00000100);
> - nv_wr32(priv, 0x00b220, nv44_graph_class(priv) ? 0x00000044 : 0x00000031);
> + if (nv_device(priv)->chipset >= 0x40 && nv44_graph_class(priv))
> + nv_wr32(priv, 0x00b220, 0x00000044);
> + else
> + nv_wr32(priv, 0x00b220, 0x00000031);
Might be a nitpicking too much, but I believe the check makes more sense
inside nv44_graph_class(), despite that this is the only nv3x context
that uses it
Emil
> nv_wr32(priv, 0x00b300, 0x02001ec1);
> nv_mask(priv, 0x00b32c, 0x00000001, 0x00000001);
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 3/3] drm/nv31/mpeg: don't recognize nv3x cards as having nv44 graph class
[not found] ` <51F6FA5A.3030703-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-07-29 23:30 ` Ilia Mirkin
0 siblings, 0 replies; 5+ messages in thread
From: Ilia Mirkin @ 2013-07-29 23:30 UTC (permalink / raw)
To: Emil Velikov; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Ben Skeggs
On Mon, Jul 29, 2013 at 7:27 PM, Emil Velikov <emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On 30/07/13 00:05, Ilia Mirkin wrote:
>> Signed-off-by: Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
>> ---
>> drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
>> index 9f7c7d5..c190043 100644
>> --- a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
>> +++ b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
>> @@ -284,7 +284,10 @@ nv31_mpeg_init(struct nouveau_object *object)
>> /* PMPEG init */
>> nv_wr32(priv, 0x00b32c, 0x00000000);
>> nv_wr32(priv, 0x00b314, 0x00000100);
>> - nv_wr32(priv, 0x00b220, nv44_graph_class(priv) ? 0x00000044 : 0x00000031);
>> + if (nv_device(priv)->chipset >= 0x40 && nv44_graph_class(priv))
>> + nv_wr32(priv, 0x00b220, 0x00000044);
>> + else
>> + nv_wr32(priv, 0x00b220, 0x00000031);
> Might be a nitpicking too much, but I believe the check makes more sense
> inside nv44_graph_class(), despite that this is the only nv3x context
> that uses it
Yeah, I was going back and forth on that. My final conclusion is that
you should only be using nv44_graph_class if you're already nv40, and
this is a bit of an abuse. So it has to do more checking as a result.
But I can definitely see it the other way too... I don't think any of
the uses are in a sufficiently fast path where an extra conditional
would matter. Ben, up to you.
-ilia
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-07-29 23:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-29 23:05 [PATCH 1/3] drm/nouveau: remove duplicate copy of nv44_graph_class Ilia Mirkin
[not found] ` <1375139118-17398-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2013-07-29 23:05 ` [PATCH 2/3] drm/nv40/mpeg: write magic value to channel object to make it work Ilia Mirkin
2013-07-29 23:05 ` [PATCH 3/3] drm/nv31/mpeg: don't recognize nv3x cards as having nv44 graph class Ilia Mirkin
[not found] ` <1375139118-17398-3-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2013-07-29 23:27 ` Emil Velikov
[not found] ` <51F6FA5A.3030703-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-29 23:30 ` Ilia Mirkin
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.