Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228605
b: refs/heads/master
c: fd70b6c
h: refs/heads/master
i:
  228603: 10fc21d
v: v3
  • Loading branch information
Francisco Jerez authored and Ben Skeggs committed Dec 8, 2010
1 parent 52f0637 commit 5489cb5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 60d2a88ae896ae51c76f8b15c2f4b762d5b00864
refs/heads/master: fd70b6cd780742b97f525415bf5e4fb24a4bb6d8
4 changes: 2 additions & 2 deletions trunk/drivers/gpu/drm/nouveau/nouveau_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,8 @@ extern void nouveau_irq_uninstall(struct drm_device *);
/* nouveau_sgdma.c */
extern int nouveau_sgdma_init(struct drm_device *);
extern void nouveau_sgdma_takedown(struct drm_device *);
extern int nouveau_sgdma_get_page(struct drm_device *, uint32_t offset,
uint32_t *page);
extern uint32_t nouveau_sgdma_get_physical(struct drm_device *,
uint32_t offset);
extern struct ttm_backend *nouveau_sgdma_init_ttm(struct drm_device *);

/* nouveau_debugfs.c */
Expand Down
8 changes: 2 additions & 6 deletions trunk/drivers/gpu/drm/nouveau/nouveau_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ nouveau_gpuobj_dma_new(struct nouveau_channel *chan, int class, u64 base,
struct drm_nouveau_private *dev_priv = chan->dev->dev_private;
struct drm_device *dev = chan->dev;
struct nouveau_gpuobj *obj;
u32 page_addr, flags0, flags2;
u32 flags0, flags2;
int ret;

if (dev_priv->card_type >= NV_50) {
Expand All @@ -495,12 +495,8 @@ nouveau_gpuobj_dma_new(struct nouveau_channel *chan, int class, u64 base,
base += dev_priv->gart_info.aper_base;
} else
if (base != 0) {
ret = nouveau_sgdma_get_page(dev, base, &page_addr);
if (ret)
return ret;

base = nouveau_sgdma_get_physical(dev, base);
target = NV_MEM_TARGET_PCI;
base = page_addr;
} else {
nouveau_gpuobj_ref(dev_priv->gart_info.sg_ctxdma, pobj);
return 0;
Expand Down
16 changes: 6 additions & 10 deletions trunk/drivers/gpu/drm/nouveau/nouveau_sgdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,19 +267,15 @@ nouveau_sgdma_takedown(struct drm_device *dev)
nouveau_vm_put(&dev_priv->gart_info.vma);
}

int
nouveau_sgdma_get_page(struct drm_device *dev, uint32_t offset, uint32_t *page)
uint32_t
nouveau_sgdma_get_physical(struct drm_device *dev, uint32_t offset)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_gpuobj *gpuobj = dev_priv->gart_info.sg_ctxdma;
int pte;
int pte = (offset >> NV_CTXDMA_PAGE_SHIFT) + 2;

pte = (offset >> NV_CTXDMA_PAGE_SHIFT) << 2;
if (dev_priv->card_type < NV_50) {
*page = nv_ro32(gpuobj, (pte + 8)) & ~NV_CTXDMA_PAGE_MASK;
return 0;
}
BUG_ON(dev_priv->card_type >= NV_50);

NV_ERROR(dev, "Unimplemented on NV50\n");
return -EINVAL;
return (nv_ro32(gpuobj, 4 * pte) & ~NV_CTXDMA_PAGE_MASK) |
(offset & NV_CTXDMA_PAGE_MASK);
}

0 comments on commit 5489cb5

Please sign in to comment.