-----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJaCm8RAAoJEAx081l5xIa+zX0QAJSm31kCG3vdw2CNiRx25L3q 3hcsEOgAjVJ9FQVGKFWjzb8TK35tSqtNx5kWIj0VGaIfBE5Bdg5SLLgKKUYas8rY 4LaphqICq2uxu2BNa2tpiar/sHhAnuozwQ4czpVWXzlaISnb9yYzRl7gMuyUVGkx +Gih5VUhLmQC0HsRTLJ3vaZQoUsLAl2gAjKcWa1bx57j2S+iKOPfsLaq7VYo+y1I Njc+iSGqMhJzRLXVkxL2lQKaslp7R38Bbh5K4Kvyjkm4Aq7zErOF6irpOXKMcrGl mwnr89vf1G9thjikrBaXpKnuvdbWYveoN/ORMlTdCfxkFnChHLnm3bd7NJ49RXDN Hv/Iq9YYjmZ9GTatxnx7lWtmXnZXC5he1yn1JAuz/yt7/0b/Wx+Mu/wEpBXYNFTd 1AZdD586i+AmPo3yDkqH9nBu8JC0W0AnS9VZma4LVvZOP2UfJmj5Im1CLHItbGDN FnUCkwyD/lJUUk+WgT+w/GOMJgmFHDiFFl4tFtYVVjrUirpCFVguSKG9xuv6tT8P 8iRsoP7RrcmDN9ojN2SEHwcpsAv3HnKkDv+9+GIbWnrGsSbCPq8Qm+JDSvf4h22I K5lwNpJrcpSKI+q10L7w2xliTBwb98sJkWGA/rssomrdBOWteGZAyqFRYAVgQ+mJ x/nJurIqQYh2KQN9+uLG =xVV2 -----END PGP SIGNATURE----- Merge tag 'drm-for-v4.15' of git://people.freedesktop.org/~airlied/linux Pull drm updates from Dave Airlie: "This is the main drm pull request for v4.15. Core: - Atomic object lifetime fixes - Atomic iterator improvements - Sparse/smatch fixes - Legacy kms ioctls to be interruptible - EDID override improvements - fb/gem helper cleanups - Simple outreachy patches - Documentation improvements - Fix dma-buf rcu races - DRM mode object leasing for improving VR use cases. - vgaarb improvements for non-x86 platforms. New driver: - tve200: Faraday Technology TVE200 block. This "TV Encoder" encodes a ITU-T BT.656 stream and can be found in the StorLink SL3516 (later Cortina Systems CS3516) as well as the Grain Media GM8180. New bridges: - SiI9234 support New panels: - S6E63J0X03, OTM8009A, Seiko 43WVF1G, 7" rpi touch panel, Toshiba LT089AC19000, Innolux AT043TN24 i915: - Remove Coffeelake from alpha support - Cannonlake workarounds - Infoframe refactoring for DisplayPort - VBT updates - DisplayPort vswing/emph/buffer translation refactoring - CCS fixes - Restore GPU clock boost on missed vblanks - Scatter list updates for userptr allocations - Gen9+ transition watermarks - Display IPC (Isochronous Priority Control) - Private PAT management - GVT: improved error handling and pci config sanitizing - Execlist refactoring - Transparent Huge Page support - User defined priorities support - HuC/GuC firmware refactoring - DP MST fixes - eDP power sequencing fixes - Use RCU instead of stop_machine - PSR state tracking support - Eviction fixes - BDW DP aux channel timeout fixes - LSPCON fixes - Cannonlake PLL fixes amdgpu: - Per VM BO support - Powerplay cleanups - CI powerplay support - PASID mgr for kfd - SR-IOV fixes - initial GPU reset for vega10 - Prime mmap support - TTM updates - Clock query interface for Raven - Fence to handle ioctl - UVD encode ring support on Polaris - Transparent huge page DMA support - Compute LRU pipe tweaks - BO flag to allow buffers to opt out of implicit sync - CTX priority setting API - VRAM lost infrastructure plumbing qxl: - fix flicker since atomic rework amdkfd: - Further improvements from internal AMD tree - Usermode events - Drop radeon support nouveau: - Pascal temperature sensor support - Improved BAR2 handling - MMU rework to support Pascal MMU exynos: - Improved HDMI/mixer support - HDMI audio interface support tegra: - Prep work for tegra186 - Cleanup/fixes msm: - Preemption support for a5xx - Display fixes for 8x96 (snapdragon 820) - Async cursor plane fixes - FW loading rework - GPU debugging improvements vc4: - Prep for DSI panels - fix T-format tiling scanout - New madvise ioctl Rockchip: - LVDS support omapdrm: - omap4 HDMI CEC support etnaviv: - GPU performance counters groundwork sun4i: - refactor driver load + TCON backend - HDMI improvements - A31 support - Misc fixes udl: - Probe/EDID read fixes. tilcdc: - Misc fixes. pl111: - Support more variants adv7511: - Improve EDID handling. - HDMI CEC support sii8620: - Add remote control support" * tag 'drm-for-v4.15' of git://people.freedesktop.org/~airlied/linux: (1480 commits) drm/rockchip: analogix_dp: Use mutex rather than spinlock drm/mode_object: fix documentation for object lookups. drm/i915: Reorder context-close to avoid calling i915_vma_close() under RCU drm/i915: Move init_clock_gating() back to where it was drm/i915: Prune the reservation shared fence array drm/i915: Idle the GPU before shinking everything drm/i915: Lock llist_del_first() vs llist_del_all() drm/i915: Calculate ironlake intermediate watermarks correctly, v2. drm/i915: Disable lazy PPGTT page table optimization for vGPU drm/i915/execlists: Remove the priority "optimisation" drm/i915: Filter out spurious execlists context-switch interrupts drm/amdgpu: use irq-safe lock for kiq->ring_lock drm/amdgpu: bypass lru touch for KIQ ring submission drm/amdgpu: Potential uninitialized variable in amdgpu_vm_update_directories() drm/amdgpu: potential uninitialized variable in amdgpu_vce_ring_parse_cs() drm/amd/powerplay: initialize a variable before using it drm/amd/powerplay: suppress KASAN out of bounds warning in vega10_populate_all_memory_levels drm/amd/amdgpu: fix evicted VRAM bo adjudgement condition drm/vblank: Tune drm_crtc_accurate_vblank_count() WARN down to a debug drm/rockchip: add CONFIG_OF dependency for lvds ...
377 lines
12 KiB
C
377 lines
12 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include "nv20.h"
|
|
#include "regs.h"
|
|
|
|
#include <core/client.h>
|
|
#include <core/gpuobj.h>
|
|
#include <engine/fifo.h>
|
|
#include <engine/fifo/chan.h>
|
|
#include <subdev/fb.h>
|
|
#include <subdev/timer.h>
|
|
|
|
/*******************************************************************************
|
|
* PGRAPH context
|
|
******************************************************************************/
|
|
|
|
int
|
|
nv20_gr_chan_init(struct nvkm_object *object)
|
|
{
|
|
struct nv20_gr_chan *chan = nv20_gr_chan(object);
|
|
struct nv20_gr *gr = chan->gr;
|
|
u32 inst = nvkm_memory_addr(chan->inst);
|
|
|
|
nvkm_kmap(gr->ctxtab);
|
|
nvkm_wo32(gr->ctxtab, chan->chid * 4, inst >> 4);
|
|
nvkm_done(gr->ctxtab);
|
|
return 0;
|
|
}
|
|
|
|
int
|
|
nv20_gr_chan_fini(struct nvkm_object *object, bool suspend)
|
|
{
|
|
struct nv20_gr_chan *chan = nv20_gr_chan(object);
|
|
struct nv20_gr *gr = chan->gr;
|
|
struct nvkm_device *device = gr->base.engine.subdev.device;
|
|
u32 inst = nvkm_memory_addr(chan->inst);
|
|
int chid = -1;
|
|
|
|
nvkm_mask(device, 0x400720, 0x00000001, 0x00000000);
|
|
if (nvkm_rd32(device, 0x400144) & 0x00010000)
|
|
chid = (nvkm_rd32(device, 0x400148) & 0x1f000000) >> 24;
|
|
if (chan->chid == chid) {
|
|
nvkm_wr32(device, 0x400784, inst >> 4);
|
|
nvkm_wr32(device, 0x400788, 0x00000002);
|
|
nvkm_msec(device, 2000,
|
|
if (!nvkm_rd32(device, 0x400700))
|
|
break;
|
|
);
|
|
nvkm_wr32(device, 0x400144, 0x10000000);
|
|
nvkm_mask(device, 0x400148, 0xff000000, 0x1f000000);
|
|
}
|
|
nvkm_mask(device, 0x400720, 0x00000001, 0x00000001);
|
|
|
|
nvkm_kmap(gr->ctxtab);
|
|
nvkm_wo32(gr->ctxtab, chan->chid * 4, 0x00000000);
|
|
nvkm_done(gr->ctxtab);
|
|
return 0;
|
|
}
|
|
|
|
void *
|
|
nv20_gr_chan_dtor(struct nvkm_object *object)
|
|
{
|
|
struct nv20_gr_chan *chan = nv20_gr_chan(object);
|
|
nvkm_memory_unref(&chan->inst);
|
|
return chan;
|
|
}
|
|
|
|
static const struct nvkm_object_func
|
|
nv20_gr_chan = {
|
|
.dtor = nv20_gr_chan_dtor,
|
|
.init = nv20_gr_chan_init,
|
|
.fini = nv20_gr_chan_fini,
|
|
};
|
|
|
|
static int
|
|
nv20_gr_chan_new(struct nvkm_gr *base, struct nvkm_fifo_chan *fifoch,
|
|
const struct nvkm_oclass *oclass, struct nvkm_object **pobject)
|
|
{
|
|
struct nv20_gr *gr = nv20_gr(base);
|
|
struct nv20_gr_chan *chan;
|
|
int ret, i;
|
|
|
|
if (!(chan = kzalloc(sizeof(*chan), GFP_KERNEL)))
|
|
return -ENOMEM;
|
|
nvkm_object_ctor(&nv20_gr_chan, oclass, &chan->object);
|
|
chan->gr = gr;
|
|
chan->chid = fifoch->chid;
|
|
*pobject = &chan->object;
|
|
|
|
ret = nvkm_memory_new(gr->base.engine.subdev.device,
|
|
NVKM_MEM_TARGET_INST, 0x37f0, 16, true,
|
|
&chan->inst);
|
|
if (ret)
|
|
return ret;
|
|
|
|
nvkm_kmap(chan->inst);
|
|
nvkm_wo32(chan->inst, 0x0000, 0x00000001 | (chan->chid << 24));
|
|
nvkm_wo32(chan->inst, 0x033c, 0xffff0000);
|
|
nvkm_wo32(chan->inst, 0x03a0, 0x0fff0000);
|
|
nvkm_wo32(chan->inst, 0x03a4, 0x0fff0000);
|
|
nvkm_wo32(chan->inst, 0x047c, 0x00000101);
|
|
nvkm_wo32(chan->inst, 0x0490, 0x00000111);
|
|
nvkm_wo32(chan->inst, 0x04a8, 0x44400000);
|
|
for (i = 0x04d4; i <= 0x04e0; i += 4)
|
|
nvkm_wo32(chan->inst, i, 0x00030303);
|
|
for (i = 0x04f4; i <= 0x0500; i += 4)
|
|
nvkm_wo32(chan->inst, i, 0x00080000);
|
|
for (i = 0x050c; i <= 0x0518; i += 4)
|
|
nvkm_wo32(chan->inst, i, 0x01012000);
|
|
for (i = 0x051c; i <= 0x0528; i += 4)
|
|
nvkm_wo32(chan->inst, i, 0x000105b8);
|
|
for (i = 0x052c; i <= 0x0538; i += 4)
|
|
nvkm_wo32(chan->inst, i, 0x00080008);
|
|
for (i = 0x055c; i <= 0x0598; i += 4)
|
|
nvkm_wo32(chan->inst, i, 0x07ff0000);
|
|
nvkm_wo32(chan->inst, 0x05a4, 0x4b7fffff);
|
|
nvkm_wo32(chan->inst, 0x05fc, 0x00000001);
|
|
nvkm_wo32(chan->inst, 0x0604, 0x00004000);
|
|
nvkm_wo32(chan->inst, 0x0610, 0x00000001);
|
|
nvkm_wo32(chan->inst, 0x0618, 0x00040000);
|
|
nvkm_wo32(chan->inst, 0x061c, 0x00010000);
|
|
for (i = 0x1c1c; i <= 0x248c; i += 16) {
|
|
nvkm_wo32(chan->inst, (i + 0), 0x10700ff9);
|
|
nvkm_wo32(chan->inst, (i + 4), 0x0436086c);
|
|
nvkm_wo32(chan->inst, (i + 8), 0x000c001b);
|
|
}
|
|
nvkm_wo32(chan->inst, 0x281c, 0x3f800000);
|
|
nvkm_wo32(chan->inst, 0x2830, 0x3f800000);
|
|
nvkm_wo32(chan->inst, 0x285c, 0x40000000);
|
|
nvkm_wo32(chan->inst, 0x2860, 0x3f800000);
|
|
nvkm_wo32(chan->inst, 0x2864, 0x3f000000);
|
|
nvkm_wo32(chan->inst, 0x286c, 0x40000000);
|
|
nvkm_wo32(chan->inst, 0x2870, 0x3f800000);
|
|
nvkm_wo32(chan->inst, 0x2878, 0xbf800000);
|
|
nvkm_wo32(chan->inst, 0x2880, 0xbf800000);
|
|
nvkm_wo32(chan->inst, 0x34a4, 0x000fe000);
|
|
nvkm_wo32(chan->inst, 0x3530, 0x000003f8);
|
|
nvkm_wo32(chan->inst, 0x3540, 0x002fe000);
|
|
for (i = 0x355c; i <= 0x3578; i += 4)
|
|
nvkm_wo32(chan->inst, i, 0x001c527c);
|
|
nvkm_done(chan->inst);
|
|
return 0;
|
|
}
|
|
|
|
/*******************************************************************************
|
|
* PGRAPH engine/subdev functions
|
|
******************************************************************************/
|
|
|
|
void
|
|
nv20_gr_tile(struct nvkm_gr *base, int i, struct nvkm_fb_tile *tile)
|
|
{
|
|
struct nv20_gr *gr = nv20_gr(base);
|
|
struct nvkm_device *device = gr->base.engine.subdev.device;
|
|
struct nvkm_fifo *fifo = device->fifo;
|
|
unsigned long flags;
|
|
|
|
nvkm_fifo_pause(fifo, &flags);
|
|
nv04_gr_idle(&gr->base);
|
|
|
|
nvkm_wr32(device, NV20_PGRAPH_TLIMIT(i), tile->limit);
|
|
nvkm_wr32(device, NV20_PGRAPH_TSIZE(i), tile->pitch);
|
|
nvkm_wr32(device, NV20_PGRAPH_TILE(i), tile->addr);
|
|
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_INDEX, 0x00EA0030 + 4 * i);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_DATA, tile->limit);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_INDEX, 0x00EA0050 + 4 * i);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_DATA, tile->pitch);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_INDEX, 0x00EA0010 + 4 * i);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_DATA, tile->addr);
|
|
|
|
if (device->chipset != 0x34) {
|
|
nvkm_wr32(device, NV20_PGRAPH_ZCOMP(i), tile->zcomp);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_INDEX, 0x00ea0090 + 4 * i);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_DATA, tile->zcomp);
|
|
}
|
|
|
|
nvkm_fifo_start(fifo, &flags);
|
|
}
|
|
|
|
void
|
|
nv20_gr_intr(struct nvkm_gr *base)
|
|
{
|
|
struct nv20_gr *gr = nv20_gr(base);
|
|
struct nvkm_subdev *subdev = &gr->base.engine.subdev;
|
|
struct nvkm_device *device = subdev->device;
|
|
struct nvkm_fifo_chan *chan;
|
|
u32 stat = nvkm_rd32(device, NV03_PGRAPH_INTR);
|
|
u32 nsource = nvkm_rd32(device, NV03_PGRAPH_NSOURCE);
|
|
u32 nstatus = nvkm_rd32(device, NV03_PGRAPH_NSTATUS);
|
|
u32 addr = nvkm_rd32(device, NV04_PGRAPH_TRAPPED_ADDR);
|
|
u32 chid = (addr & 0x01f00000) >> 20;
|
|
u32 subc = (addr & 0x00070000) >> 16;
|
|
u32 mthd = (addr & 0x00001ffc);
|
|
u32 data = nvkm_rd32(device, NV04_PGRAPH_TRAPPED_DATA);
|
|
u32 class = nvkm_rd32(device, 0x400160 + subc * 4) & 0xfff;
|
|
u32 show = stat;
|
|
char msg[128], src[128], sta[128];
|
|
unsigned long flags;
|
|
|
|
chan = nvkm_fifo_chan_chid(device->fifo, chid, &flags);
|
|
|
|
nvkm_wr32(device, NV03_PGRAPH_INTR, stat);
|
|
nvkm_wr32(device, NV04_PGRAPH_FIFO, 0x00000001);
|
|
|
|
if (show) {
|
|
nvkm_snprintbf(msg, sizeof(msg), nv10_gr_intr_name, show);
|
|
nvkm_snprintbf(src, sizeof(src), nv04_gr_nsource, nsource);
|
|
nvkm_snprintbf(sta, sizeof(sta), nv10_gr_nstatus, nstatus);
|
|
nvkm_error(subdev, "intr %08x [%s] nsource %08x [%s] "
|
|
"nstatus %08x [%s] ch %d [%s] subc %d "
|
|
"class %04x mthd %04x data %08x\n",
|
|
show, msg, nsource, src, nstatus, sta, chid,
|
|
chan ? chan->object.client->name : "unknown",
|
|
subc, class, mthd, data);
|
|
}
|
|
|
|
nvkm_fifo_chan_put(device->fifo, flags, &chan);
|
|
}
|
|
|
|
int
|
|
nv20_gr_oneinit(struct nvkm_gr *base)
|
|
{
|
|
struct nv20_gr *gr = nv20_gr(base);
|
|
return nvkm_memory_new(gr->base.engine.subdev.device,
|
|
NVKM_MEM_TARGET_INST, 32 * 4, 16,
|
|
true, &gr->ctxtab);
|
|
}
|
|
|
|
int
|
|
nv20_gr_init(struct nvkm_gr *base)
|
|
{
|
|
struct nv20_gr *gr = nv20_gr(base);
|
|
struct nvkm_device *device = gr->base.engine.subdev.device;
|
|
u32 tmp, vramsz;
|
|
int i;
|
|
|
|
nvkm_wr32(device, NV20_PGRAPH_CHANNEL_CTX_TABLE,
|
|
nvkm_memory_addr(gr->ctxtab) >> 4);
|
|
|
|
if (device->chipset == 0x20) {
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_INDEX, 0x003d0000);
|
|
for (i = 0; i < 15; i++)
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_DATA, 0x00000000);
|
|
nvkm_msec(device, 2000,
|
|
if (!nvkm_rd32(device, 0x400700))
|
|
break;
|
|
);
|
|
} else {
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_INDEX, 0x02c80000);
|
|
for (i = 0; i < 32; i++)
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_DATA, 0x00000000);
|
|
nvkm_msec(device, 2000,
|
|
if (!nvkm_rd32(device, 0x400700))
|
|
break;
|
|
);
|
|
}
|
|
|
|
nvkm_wr32(device, NV03_PGRAPH_INTR , 0xFFFFFFFF);
|
|
nvkm_wr32(device, NV03_PGRAPH_INTR_EN, 0xFFFFFFFF);
|
|
|
|
nvkm_wr32(device, NV04_PGRAPH_DEBUG_0, 0xFFFFFFFF);
|
|
nvkm_wr32(device, NV04_PGRAPH_DEBUG_0, 0x00000000);
|
|
nvkm_wr32(device, NV04_PGRAPH_DEBUG_1, 0x00118700);
|
|
nvkm_wr32(device, NV04_PGRAPH_DEBUG_3, 0xF3CE0475); /* 0x4 = auto ctx switch */
|
|
nvkm_wr32(device, NV10_PGRAPH_DEBUG_4, 0x00000000);
|
|
nvkm_wr32(device, 0x40009C , 0x00000040);
|
|
|
|
if (device->chipset >= 0x25) {
|
|
nvkm_wr32(device, 0x400890, 0x00a8cfff);
|
|
nvkm_wr32(device, 0x400610, 0x304B1FB6);
|
|
nvkm_wr32(device, 0x400B80, 0x1cbd3883);
|
|
nvkm_wr32(device, 0x400B84, 0x44000000);
|
|
nvkm_wr32(device, 0x400098, 0x40000080);
|
|
nvkm_wr32(device, 0x400B88, 0x000000ff);
|
|
|
|
} else {
|
|
nvkm_wr32(device, 0x400880, 0x0008c7df);
|
|
nvkm_wr32(device, 0x400094, 0x00000005);
|
|
nvkm_wr32(device, 0x400B80, 0x45eae20e);
|
|
nvkm_wr32(device, 0x400B84, 0x24000000);
|
|
nvkm_wr32(device, 0x400098, 0x00000040);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_INDEX, 0x00E00038);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_DATA , 0x00000030);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_INDEX, 0x00E10038);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_DATA , 0x00000030);
|
|
}
|
|
|
|
nvkm_wr32(device, 0x4009a0, nvkm_rd32(device, 0x100324));
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_INDEX, 0x00EA000C);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_DATA, nvkm_rd32(device, 0x100324));
|
|
|
|
nvkm_wr32(device, NV10_PGRAPH_CTX_CONTROL, 0x10000100);
|
|
nvkm_wr32(device, NV10_PGRAPH_STATE , 0xFFFFFFFF);
|
|
|
|
tmp = nvkm_rd32(device, NV10_PGRAPH_SURFACE) & 0x0007ff00;
|
|
nvkm_wr32(device, NV10_PGRAPH_SURFACE, tmp);
|
|
tmp = nvkm_rd32(device, NV10_PGRAPH_SURFACE) | 0x00020100;
|
|
nvkm_wr32(device, NV10_PGRAPH_SURFACE, tmp);
|
|
|
|
/* begin RAM config */
|
|
vramsz = device->func->resource_size(device, 1) - 1;
|
|
nvkm_wr32(device, 0x4009A4, nvkm_rd32(device, 0x100200));
|
|
nvkm_wr32(device, 0x4009A8, nvkm_rd32(device, 0x100204));
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_INDEX, 0x00EA0000);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_DATA , nvkm_rd32(device, 0x100200));
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_INDEX, 0x00EA0004);
|
|
nvkm_wr32(device, NV10_PGRAPH_RDI_DATA , nvkm_rd32(device, 0x100204));
|
|
nvkm_wr32(device, 0x400820, 0);
|
|
nvkm_wr32(device, 0x400824, 0);
|
|
nvkm_wr32(device, 0x400864, vramsz - 1);
|
|
nvkm_wr32(device, 0x400868, vramsz - 1);
|
|
|
|
/* interesting.. the below overwrites some of the tile setup above.. */
|
|
nvkm_wr32(device, 0x400B20, 0x00000000);
|
|
nvkm_wr32(device, 0x400B04, 0xFFFFFFFF);
|
|
|
|
nvkm_wr32(device, NV03_PGRAPH_ABS_UCLIP_XMIN, 0);
|
|
nvkm_wr32(device, NV03_PGRAPH_ABS_UCLIP_YMIN, 0);
|
|
nvkm_wr32(device, NV03_PGRAPH_ABS_UCLIP_XMAX, 0x7fff);
|
|
nvkm_wr32(device, NV03_PGRAPH_ABS_UCLIP_YMAX, 0x7fff);
|
|
return 0;
|
|
}
|
|
|
|
void *
|
|
nv20_gr_dtor(struct nvkm_gr *base)
|
|
{
|
|
struct nv20_gr *gr = nv20_gr(base);
|
|
nvkm_memory_unref(&gr->ctxtab);
|
|
return gr;
|
|
}
|
|
|
|
int
|
|
nv20_gr_new_(const struct nvkm_gr_func *func, struct nvkm_device *device,
|
|
int index, struct nvkm_gr **pgr)
|
|
{
|
|
struct nv20_gr *gr;
|
|
|
|
if (!(gr = kzalloc(sizeof(*gr), GFP_KERNEL)))
|
|
return -ENOMEM;
|
|
*pgr = &gr->base;
|
|
|
|
return nvkm_gr_ctor(func, device, index, true, &gr->base);
|
|
}
|
|
|
|
static const struct nvkm_gr_func
|
|
nv20_gr = {
|
|
.dtor = nv20_gr_dtor,
|
|
.oneinit = nv20_gr_oneinit,
|
|
.init = nv20_gr_init,
|
|
.intr = nv20_gr_intr,
|
|
.tile = nv20_gr_tile,
|
|
.chan_new = nv20_gr_chan_new,
|
|
.sclass = {
|
|
{ -1, -1, 0x0012, &nv04_gr_object }, /* beta1 */
|
|
{ -1, -1, 0x0019, &nv04_gr_object }, /* clip */
|
|
{ -1, -1, 0x0030, &nv04_gr_object }, /* null */
|
|
{ -1, -1, 0x0039, &nv04_gr_object }, /* m2mf */
|
|
{ -1, -1, 0x0043, &nv04_gr_object }, /* rop */
|
|
{ -1, -1, 0x0044, &nv04_gr_object }, /* patt */
|
|
{ -1, -1, 0x004a, &nv04_gr_object }, /* gdi */
|
|
{ -1, -1, 0x0062, &nv04_gr_object }, /* surf2d */
|
|
{ -1, -1, 0x0072, &nv04_gr_object }, /* beta4 */
|
|
{ -1, -1, 0x0089, &nv04_gr_object }, /* sifm */
|
|
{ -1, -1, 0x008a, &nv04_gr_object }, /* ifc */
|
|
{ -1, -1, 0x0096, &nv04_gr_object }, /* celcius */
|
|
{ -1, -1, 0x0097, &nv04_gr_object }, /* kelvin */
|
|
{ -1, -1, 0x009e, &nv04_gr_object }, /* swzsurf */
|
|
{ -1, -1, 0x009f, &nv04_gr_object }, /* imageblit */
|
|
{}
|
|
}
|
|
};
|
|
|
|
int
|
|
nv20_gr_new(struct nvkm_device *device, int index, struct nvkm_gr **pgr)
|
|
{
|
|
return nv20_gr_new_(&nv20_gr, device, index, pgr);
|
|
}
|