diff options
Diffstat (limited to 'freedreno/freedreno_pipe.c')
-rw-r--r-- | freedreno/freedreno_pipe.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/freedreno/freedreno_pipe.c b/freedreno/freedreno_pipe.c index 3f8c8342..77b160e7 100644 --- a/freedreno/freedreno_pipe.c +++ b/freedreno/freedreno_pipe.c | |||
@@ -26,28 +26,33 @@ | |||
26 | * Rob Clark <robclark@freedesktop.org> | 26 | * Rob Clark <robclark@freedesktop.org> |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifdef HAVE_CONFIG_H | ||
30 | # include <config.h> | ||
31 | #endif | ||
32 | |||
33 | #include "freedreno_drmif.h" | 29 | #include "freedreno_drmif.h" |
34 | #include "freedreno_priv.h" | 30 | #include "freedreno_priv.h" |
35 | 31 | ||
32 | /** | ||
33 | * priority of zero is highest priority, and higher numeric values are | ||
34 | * lower priorities | ||
35 | */ | ||
36 | struct fd_pipe * | 36 | struct fd_pipe * |
37 | fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id) | 37 | fd_pipe_new2(struct fd_device *dev, enum fd_pipe_id id, uint32_t prio) |
38 | { | 38 | { |
39 | struct fd_pipe *pipe = NULL; | 39 | struct fd_pipe *pipe; |
40 | uint64_t val; | 40 | uint64_t val; |
41 | 41 | ||
42 | if (id > FD_PIPE_MAX) { | 42 | if (id > FD_PIPE_MAX) { |
43 | ERROR_MSG("invalid pipe id: %d", id); | 43 | ERROR_MSG("invalid pipe id: %d", id); |
44 | goto fail; | 44 | return NULL; |
45 | } | ||
46 | |||
47 | if ((prio != 1) && (fd_device_version(dev) < FD_VERSION_SUBMIT_QUEUES)) { | ||
48 | ERROR_MSG("invalid priority!"); | ||
49 | return NULL; | ||
45 | } | 50 | } |
46 | 51 | ||
47 | pipe = dev->funcs->pipe_new(dev, id); | 52 | pipe = dev->funcs->pipe_new(dev, id, prio); |
48 | if (!pipe) { | 53 | if (!pipe) { |
49 | ERROR_MSG("allocation failed"); | 54 | ERROR_MSG("allocation failed"); |
50 | goto fail; | 55 | return NULL; |
51 | } | 56 | } |
52 | 57 | ||
53 | pipe->dev = dev; | 58 | pipe->dev = dev; |
@@ -57,10 +62,12 @@ fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id) | |||
57 | pipe->gpu_id = val; | 62 | pipe->gpu_id = val; |
58 | 63 | ||
59 | return pipe; | 64 | return pipe; |
60 | fail: | 65 | } |
61 | if (pipe) | 66 | |
62 | fd_pipe_del(pipe); | 67 | struct fd_pipe * |
63 | return NULL; | 68 | fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id) |
69 | { | ||
70 | return fd_pipe_new2(dev, id, 1); | ||
64 | } | 71 | } |
65 | 72 | ||
66 | void fd_pipe_del(struct fd_pipe *pipe) | 73 | void fd_pipe_del(struct fd_pipe *pipe) |