Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
63187215
Commit
63187215
authored
Jul 08, 2010
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nv50: move tlb flushing to a helper function
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
f56cb86f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
97 deletions
+23
-97
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+1
-0
drivers/gpu/drm/nouveau/nouveau_mem.c
drivers/gpu/drm/nouveau/nouveau_mem.c
+8
-54
drivers/gpu/drm/nouveau/nouveau_sgdma.c
drivers/gpu/drm/nouveau/nouveau_sgdma.c
+4
-30
drivers/gpu/drm/nouveau/nv50_instmem.c
drivers/gpu/drm/nouveau/nv50_instmem.c
+10
-13
No files found.
drivers/gpu/drm/nouveau/nouveau_drv.h
View file @
63187215
...
...
@@ -1039,6 +1039,7 @@ extern void nv50_instmem_clear(struct drm_device *, struct nouveau_gpuobj *);
extern
int
nv50_instmem_bind
(
struct
drm_device
*
,
struct
nouveau_gpuobj
*
);
extern
int
nv50_instmem_unbind
(
struct
drm_device
*
,
struct
nouveau_gpuobj
*
);
extern
void
nv50_instmem_flush
(
struct
drm_device
*
);
extern
void
nv50_vm_flush
(
struct
drm_device
*
,
int
engine
);
/* nv04_mc.c */
extern
int
nv04_mc_init
(
struct
drm_device
*
);
...
...
drivers/gpu/drm/nouveau/nouveau_mem.c
View file @
63187215
...
...
@@ -176,34 +176,10 @@ nv50_mem_vm_bind_linear(struct drm_device *dev, uint64_t virt, uint32_t size,
}
dev_priv
->
engine
.
instmem
.
flush
(
dev
);
nv_wr32
(
dev
,
0x100c80
,
0x00050001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
-
EBUSY
;
}
nv_wr32
(
dev
,
0x100c80
,
0x00000001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
-
EBUSY
;
}
nv_wr32
(
dev
,
0x100c80
,
0x00040001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
-
EBUSY
;
}
nv_wr32
(
dev
,
0x100c80
,
0x00060001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
-
EBUSY
;
}
nv50_vm_flush
(
dev
,
5
);
nv50_vm_flush
(
dev
,
0
);
nv50_vm_flush
(
dev
,
4
);
nv50_vm_flush
(
dev
,
6
);
return
0
;
}
...
...
@@ -232,32 +208,10 @@ nv50_mem_vm_unbind(struct drm_device *dev, uint64_t virt, uint32_t size)
}
dev_priv
->
engine
.
instmem
.
flush
(
dev
);
nv_wr32
(
dev
,
0x100c80
,
0x00050001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
;
}
nv_wr32
(
dev
,
0x100c80
,
0x00000001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
;
}
nv_wr32
(
dev
,
0x100c80
,
0x00040001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
;
}
nv_wr32
(
dev
,
0x100c80
,
0x00060001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
}
nv50_vm_flush
(
dev
,
5
);
nv50_vm_flush
(
dev
,
0
);
nv50_vm_flush
(
dev
,
4
);
nv50_vm_flush
(
dev
,
6
);
}
/*
...
...
drivers/gpu/drm/nouveau/nouveau_sgdma.c
View file @
63187215
...
...
@@ -118,21 +118,8 @@ nouveau_sgdma_bind(struct ttm_backend *be, struct ttm_mem_reg *mem)
dev_priv
->
engine
.
instmem
.
flush
(
nvbe
->
dev
);
if
(
dev_priv
->
card_type
==
NV_50
)
{
nv_wr32
(
dev
,
0x100c80
,
0x00050001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
-
EBUSY
;
}
nv_wr32
(
dev
,
0x100c80
,
0x00000001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
-
EBUSY
;
}
nv50_vm_flush
(
dev
,
5
);
/* PGRAPH */
nv50_vm_flush
(
dev
,
0
);
/* PFIFO */
}
nvbe
->
bound
=
true
;
...
...
@@ -171,21 +158,8 @@ nouveau_sgdma_unbind(struct ttm_backend *be)
dev_priv
->
engine
.
instmem
.
flush
(
nvbe
->
dev
);
if
(
dev_priv
->
card_type
==
NV_50
)
{
nv_wr32
(
dev
,
0x100c80
,
0x00050001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
-
EBUSY
;
}
nv_wr32
(
dev
,
0x100c80
,
0x00000001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
-
EBUSY
;
}
nv50_vm_flush
(
dev
,
5
);
nv50_vm_flush
(
dev
,
0
);
}
nvbe
->
bound
=
false
;
...
...
drivers/gpu/drm/nouveau/nv50_instmem.c
View file @
63187215
...
...
@@ -453,19 +453,8 @@ nv50_instmem_bind(struct drm_device *dev, struct nouveau_gpuobj *gpuobj)
}
dev_priv
->
engine
.
instmem
.
flush
(
dev
);
nv_wr32
(
dev
,
0x100c80
,
0x00040001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (1)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
-
EBUSY
;
}
nv_wr32
(
dev
,
0x100c80
,
0x00060001
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
{
NV_ERROR
(
dev
,
"timeout: (0x100c80 & 1) == 0 (2)
\n
"
);
NV_ERROR
(
dev
,
"0x100c80 = 0x%08x
\n
"
,
nv_rd32
(
dev
,
0x100c80
));
return
-
EBUSY
;
}
nv50_vm_flush
(
dev
,
4
);
nv50_vm_flush
(
dev
,
6
);
gpuobj
->
im_bound
=
1
;
return
0
;
...
...
@@ -502,3 +491,11 @@ nv50_instmem_flush(struct drm_device *dev)
NV_ERROR
(
dev
,
"PRAMIN flush timeout
\n
"
);
}
void
nv50_vm_flush
(
struct
drm_device
*
dev
,
int
engine
)
{
nv_wr32
(
dev
,
0x100c80
,
(
engine
<<
16
)
|
1
);
if
(
!
nv_wait
(
0x100c80
,
0x00000001
,
0x00000000
))
NV_ERROR
(
dev
,
"vm flush timeout: engine %d
\n
"
,
engine
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment