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
2d063981
Commit
2d063981
authored
Jan 15, 2020
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/flcn/msgq: drop nvkm_msgqueue argument to functions
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
77b1ab61
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
26 deletions
+19
-26
drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c
drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c
+19
-26
No files found.
drivers/gpu/drm/nouveau/nvkm/falcon/msgq.c
View file @
2d063981
...
@@ -23,18 +23,16 @@
...
@@ -23,18 +23,16 @@
#include "qmgr.h"
#include "qmgr.h"
static
void
static
void
msg_queue_open
(
struct
nvkm_msgqueue
*
priv
,
struct
nvkm_msgqueue
_queue
*
queue
)
msg_queue_open
(
struct
nvkm_msgqueue_queue
*
queue
)
{
{
struct
nvkm_falcon
*
falcon
=
priv
->
falcon
;
mutex_lock
(
&
queue
->
mutex
);
mutex_lock
(
&
queue
->
mutex
);
queue
->
position
=
nvkm_falcon_rd32
(
falcon
,
queue
->
tail_reg
);
queue
->
position
=
nvkm_falcon_rd32
(
queue
->
qmgr
->
falcon
,
queue
->
tail_reg
);
}
}
static
void
static
void
msg_queue_close
(
struct
nvkm_msgqueue
*
priv
,
struct
nvkm_msgqueue_queue
*
queue
,
msg_queue_close
(
struct
nvkm_msgqueue_queue
*
queue
,
bool
commit
)
bool
commit
)
{
{
struct
nvkm_falcon
*
falcon
=
priv
->
falcon
;
struct
nvkm_falcon
*
falcon
=
queue
->
qmgr
->
falcon
;
if
(
commit
)
if
(
commit
)
nvkm_falcon_wr32
(
falcon
,
queue
->
tail_reg
,
queue
->
position
);
nvkm_falcon_wr32
(
falcon
,
queue
->
tail_reg
,
queue
->
position
);
...
@@ -43,19 +41,17 @@ msg_queue_close(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_queue *queue,
...
@@ -43,19 +41,17 @@ msg_queue_close(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_queue *queue,
}
}
static
bool
static
bool
msg_queue_empty
(
struct
nvkm_msgqueue
*
priv
,
struct
nvkm_msgqueue
_queue
*
queue
)
msg_queue_empty
(
struct
nvkm_msgqueue_queue
*
queue
)
{
{
struct
nvkm_falcon
*
falcon
=
priv
->
falcon
;
u32
head
=
nvkm_falcon_rd32
(
queue
->
qmgr
->
falcon
,
queue
->
head_reg
);
u32
head
=
nvkm_falcon_rd32
(
falcon
,
queue
->
head_reg
);
u32
tail
=
nvkm_falcon_rd32
(
queue
->
qmgr
->
falcon
,
queue
->
tail_reg
);
u32
tail
=
nvkm_falcon_rd32
(
falcon
,
queue
->
tail_reg
);
return
head
==
tail
;
return
head
==
tail
;
}
}
static
int
static
int
msg_queue_pop
(
struct
nvkm_msgqueue
*
priv
,
struct
nvkm_msgqueue_queue
*
queue
,
msg_queue_pop
(
struct
nvkm_msgqueue_queue
*
queue
,
void
*
data
,
u32
size
)
void
*
data
,
u32
size
)
{
{
struct
nvkm_falcon
*
falcon
=
priv
->
falcon
;
struct
nvkm_falcon
*
falcon
=
queue
->
qmgr
->
falcon
;
u32
head
,
tail
,
available
;
u32
head
,
tail
,
available
;
head
=
nvkm_falcon_rd32
(
falcon
,
queue
->
head_reg
);
head
=
nvkm_falcon_rd32
(
falcon
,
queue
->
head_reg
);
...
@@ -72,23 +68,22 @@ msg_queue_pop(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_queue *queue,
...
@@ -72,23 +68,22 @@ msg_queue_pop(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_queue *queue,
return
-
EINVAL
;
return
-
EINVAL
;
}
}
nvkm_falcon_read_dmem
(
priv
->
falcon
,
tail
,
size
,
0
,
data
);
nvkm_falcon_read_dmem
(
falcon
,
tail
,
size
,
0
,
data
);
queue
->
position
+=
ALIGN
(
size
,
QUEUE_ALIGNMENT
);
queue
->
position
+=
ALIGN
(
size
,
QUEUE_ALIGNMENT
);
return
0
;
return
0
;
}
}
static
int
static
int
msg_queue_read
(
struct
nvkm_msgqueue
*
priv
,
struct
nvkm_msgqueue_queue
*
queue
,
msg_queue_read
(
struct
nvkm_msgqueue_queue
*
queue
,
struct
nv_falcon_msg
*
hdr
)
struct
nv_falcon_msg
*
hdr
)
{
{
int
ret
=
0
;
int
ret
=
0
;
msg_queue_open
(
priv
,
queue
);
msg_queue_open
(
queue
);
if
(
msg_queue_empty
(
priv
,
queue
))
if
(
msg_queue_empty
(
queue
))
goto
close
;
goto
close
;
ret
=
msg_queue_pop
(
priv
,
queue
,
hdr
,
HDR_SIZE
);
ret
=
msg_queue_pop
(
queue
,
hdr
,
HDR_SIZE
);
if
(
ret
)
{
if
(
ret
)
{
FLCNQ_ERR
(
queue
,
"failed to read message header"
);
FLCNQ_ERR
(
queue
,
"failed to read message header"
);
goto
close
;
goto
close
;
...
@@ -103,7 +98,7 @@ msg_queue_read(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_queue *queue,
...
@@ -103,7 +98,7 @@ msg_queue_read(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_queue *queue,
if
(
hdr
->
size
>
HDR_SIZE
)
{
if
(
hdr
->
size
>
HDR_SIZE
)
{
u32
read_size
=
hdr
->
size
-
HDR_SIZE
;
u32
read_size
=
hdr
->
size
-
HDR_SIZE
;
ret
=
msg_queue_pop
(
priv
,
queue
,
(
hdr
+
1
),
read_size
);
ret
=
msg_queue_pop
(
queue
,
(
hdr
+
1
),
read_size
);
if
(
ret
)
{
if
(
ret
)
{
FLCNQ_ERR
(
queue
,
"failed to read message data"
);
FLCNQ_ERR
(
queue
,
"failed to read message data"
);
goto
close
;
goto
close
;
...
@@ -112,14 +107,12 @@ msg_queue_read(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_queue *queue,
...
@@ -112,14 +107,12 @@ msg_queue_read(struct nvkm_msgqueue *priv, struct nvkm_msgqueue_queue *queue,
ret
=
1
;
ret
=
1
;
close:
close:
msg_queue_close
(
priv
,
queue
,
(
ret
>=
0
));
msg_queue_close
(
queue
,
(
ret
>=
0
));
return
ret
;
return
ret
;
}
}
static
int
static
int
msgqueue_msg_handle
(
struct
nvkm_msgqueue
*
priv
,
msgqueue_msg_handle
(
struct
nvkm_falcon_msgq
*
msgq
,
struct
nv_falcon_msg
*
hdr
)
struct
nvkm_falcon_msgq
*
msgq
,
struct
nv_falcon_msg
*
hdr
)
{
{
struct
nvkm_falcon_qmgr_seq
*
seq
;
struct
nvkm_falcon_qmgr_seq
*
seq
;
...
@@ -197,8 +190,8 @@ nvkm_msgqueue_process_msgs(struct nvkm_msgqueue *priv,
...
@@ -197,8 +190,8 @@ nvkm_msgqueue_process_msgs(struct nvkm_msgqueue *priv,
if
(
!
ret
)
if
(
!
ret
)
priv
->
init_msg_received
=
true
;
priv
->
init_msg_received
=
true
;
}
else
{
}
else
{
while
(
msg_queue_read
(
priv
,
queue
,
hdr
)
>
0
)
while
(
msg_queue_read
(
queue
,
hdr
)
>
0
)
msgqueue_msg_handle
(
priv
,
queue
,
hdr
);
msgqueue_msg_handle
(
queue
,
hdr
);
}
}
}
}
...
...
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