[Nouveau] [PATCH] exa: add GM10x acceleration support

Ilia Mirkin imirkin at alum.mit.edu
Mon Oct 17 12:27:42 UTC 2016


On Mon, Oct 17, 2016 at 5:28 AM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> Looks reasonable, some minor comments below.
>
>
> On 10/16/2016 02:06 AM, Ilia Mirkin wrote:
>> diff --git a/src/nvc0_exa.c b/src/nvc0_exa.c
>> index 6add60b..a53dfe6 100644
>> --- a/src/nvc0_exa.c
>> +++ b/src/nvc0_exa.c
>> @@ -914,14 +914,56 @@ NVC0EXAComposite(PixmapPtr pdpix,
>>         if (!PUSH_SPACE(push, 64))
>>                 return;
>>
>> +       if (pNv->dev->chipset >= 0x110) {
>> +               BEGIN_NVC0(push, NVC0_3D(CB_SIZE), 3);
>> +               PUSH_DATA (push, 256);
>> +               PUSH_DATA (push, (pNv->scratch->offset + PVP_DATA) >> 32);
>
>
> No PUSH_DATAh in the DDX?

Nope. Didn't feel the burning need to add a helper either.

>>  $(filter %nvc0.vpc,$(SHADERS)): %.vpc: %.vp
>> -       cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -o $@
>> +       cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gf100
>> -o $@
>>  $(filter %nvc0.fpc,$(SHADERS)): %.fpc: %.fp
>> -       cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -o $@
>> +       cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gf100
>> -o $@
>>
>>  $(filter %nve0.vpc,$(SHADERS)): %.vpc: %.vp
>> -       cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -V nve4 -o
>> $@
>> +       cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gk104
>> -o $@
>>  $(filter %nve0.fpc,$(SHADERS)): %.fpc: %.fp
>> -       cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m nvc0 -V nve4 -o
>> $@
>> +       cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gf100 -V gk104
>> -o $@
>
>
> This is unrelated to your main change, but well should be *exactly* the same
> thing. :)

You mean the bit about me adding -V gf100? Figured I'd fix it up while
I was at it. The machine/variant names changed though.

>
>
>>
>>  $(filter %nvf0.vpc,$(SHADERS)): %.vpc: %.vp
>>         cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gk110 -o $@
>>  $(filter %nvf0.fpc,$(SHADERS)): %.fpc: %.fp
>>         cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gk110 -o $@
>> +
>> +$(filter %nv110.vpc,$(SHADERS)): %.vpc: %.vp
>> +       cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gm107 -o $@
>> +$(filter %nv110.fpc,$(SHADERS)): %.fpc: %.fp
>> +       cpp -DENVYAS $< | sed -e '/^#/d' | $(ENVYAS) -w -m gm107 -o $@
>> diff --git a/src/shader/exac8nv110.fp b/src/shader/exac8nv110.fp
>> new file mode 100644
>> index 0000000..ce78036
>> --- /dev/null
>> +++ b/src/shader/exac8nv110.fp
>> @@ -0,0 +1,47 @@
>> +#ifndef ENVYAS
>> +static uint32_t
>> +NV110FP_Composite_A8[] = {
>> +       0x00001462,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x80000000,
>> +       0x00000a0a,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x00000000,
>> +       0x0000000f,
>> +       0x00000000,
>> +#include "exac8nv110.fpc"
>> +};
>> +#else
>> +
>> +sched (st 0x0) (st 0x0) (st 0x0)
>
>
> Those sched codes are definitely bad, but let's keep them as it for now. I
> might have a look at some point to improve the thing.

Yeah, way wrong. However it's what our compiler would produce. You can
use this as a proving ground for your various theories. All simple
shaders though, no control flow. Only complex thing is textures.

  -ilia


More information about the Nouveau mailing list