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
Kirill Smelkov
linux
Commits
58e92b5e
Commit
58e92b5e
authored
Feb 17, 2020
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/nvif: access PTIMER through usermode class, if available
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
028a12f5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
drivers/gpu/drm/nouveau/include/nvif/user.h
drivers/gpu/drm/nouveau/include/nvif/user.h
+1
-0
drivers/gpu/drm/nouveau/nvif/device.c
drivers/gpu/drm/nouveau/nvif/device.c
+9
-5
drivers/gpu/drm/nouveau/nvif/userc361.c
drivers/gpu/drm/nouveau/nvif/userc361.c
+14
-0
No files found.
drivers/gpu/drm/nouveau/include/nvif/user.h
View file @
58e92b5e
...
@@ -10,6 +10,7 @@ struct nvif_user {
...
@@ -10,6 +10,7 @@ struct nvif_user {
struct
nvif_user_func
{
struct
nvif_user_func
{
void
(
*
doorbell
)(
struct
nvif_user
*
,
u32
token
);
void
(
*
doorbell
)(
struct
nvif_user
*
,
u32
token
);
u64
(
*
time
)(
struct
nvif_user
*
);
};
};
int
nvif_user_init
(
struct
nvif_device
*
);
int
nvif_user_init
(
struct
nvif_device
*
);
...
...
drivers/gpu/drm/nouveau/nvif/device.c
View file @
58e92b5e
...
@@ -27,11 +27,15 @@
...
@@ -27,11 +27,15 @@
u64
u64
nvif_device_time
(
struct
nvif_device
*
device
)
nvif_device_time
(
struct
nvif_device
*
device
)
{
{
if
(
!
device
->
user
.
func
)
{
struct
nv_device_time_v0
args
=
{};
struct
nv_device_time_v0
args
=
{};
int
ret
=
nvif_object_mthd
(
&
device
->
object
,
NV_DEVICE_V0_TIME
,
int
ret
=
nvif_object_mthd
(
&
device
->
object
,
NV_DEVICE_V0_TIME
,
&
args
,
sizeof
(
args
));
&
args
,
sizeof
(
args
));
WARN_ON_ONCE
(
ret
!=
0
);
WARN_ON_ONCE
(
ret
!=
0
);
return
args
.
time
;
return
args
.
time
;
}
return
device
->
user
.
func
->
time
(
&
device
->
user
);
}
}
void
void
...
...
drivers/gpu/drm/nouveau/nvif/userc361.c
View file @
58e92b5e
...
@@ -21,6 +21,19 @@
...
@@ -21,6 +21,19 @@
*/
*/
#include <nvif/user.h>
#include <nvif/user.h>
static
u64
nvif_userc361_time
(
struct
nvif_user
*
user
)
{
u32
hi
,
lo
;
do
{
hi
=
nvif_rd32
(
&
user
->
object
,
0x084
);
lo
=
nvif_rd32
(
&
user
->
object
,
0x080
);
}
while
(
hi
!=
nvif_rd32
(
&
user
->
object
,
0x084
));
return
((
u64
)
hi
<<
32
|
lo
);
}
static
void
static
void
nvif_userc361_doorbell
(
struct
nvif_user
*
user
,
u32
token
)
nvif_userc361_doorbell
(
struct
nvif_user
*
user
,
u32
token
)
{
{
...
@@ -30,4 +43,5 @@ nvif_userc361_doorbell(struct nvif_user *user, u32 token)
...
@@ -30,4 +43,5 @@ nvif_userc361_doorbell(struct nvif_user *user, u32 token)
const
struct
nvif_user_func
const
struct
nvif_user_func
nvif_userc361
=
{
nvif_userc361
=
{
.
doorbell
=
nvif_userc361_doorbell
,
.
doorbell
=
nvif_userc361_doorbell
,
.
time
=
nvif_userc361_time
,
};
};
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