diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2016-01-21 10:20:14 -0500 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2016-03-07 09:36:53 -0500 |
commit | 18060f4d87665e974950cb36133bbbf5e1b350f3 (patch) | |
tree | 72e1699431986d1a59313fec419d329f64e5eb39 | |
parent | 6e138f76b676b8c6dfa744db183776b0668ec272 (diff) |
drm: etnaviv: extract arming of semaphore
Extract out the arming of a semaphore from the pipe select code.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
-rw-r--r-- | drivers/gpu/drm/etnaviv/etnaviv_buffer.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c index 975c11b7fb38..cfd08ef33eab 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c | |||
@@ -85,10 +85,16 @@ static inline void CMD_STALL(struct etnaviv_cmdbuf *buffer, | |||
85 | OUT(buffer, VIV_FE_STALL_TOKEN_FROM(from) | VIV_FE_STALL_TOKEN_TO(to)); | 85 | OUT(buffer, VIV_FE_STALL_TOKEN_FROM(from) | VIV_FE_STALL_TOKEN_TO(to)); |
86 | } | 86 | } |
87 | 87 | ||
88 | static inline void CMD_SEM(struct etnaviv_cmdbuf *buffer, u32 from, u32 to) | ||
89 | { | ||
90 | CMD_LOAD_STATE(buffer, VIVS_GL_SEMAPHORE_TOKEN, | ||
91 | VIVS_GL_SEMAPHORE_TOKEN_FROM(from) | | ||
92 | VIVS_GL_SEMAPHORE_TOKEN_TO(to)); | ||
93 | } | ||
94 | |||
88 | static void etnaviv_cmd_select_pipe(struct etnaviv_cmdbuf *buffer, u8 pipe) | 95 | static void etnaviv_cmd_select_pipe(struct etnaviv_cmdbuf *buffer, u8 pipe) |
89 | { | 96 | { |
90 | u32 flush; | 97 | u32 flush; |
91 | u32 stall; | ||
92 | 98 | ||
93 | /* | 99 | /* |
94 | * This assumes that if we're switching to 2D, we're switching | 100 | * This assumes that if we're switching to 2D, we're switching |
@@ -101,12 +107,8 @@ static void etnaviv_cmd_select_pipe(struct etnaviv_cmdbuf *buffer, u8 pipe) | |||
101 | else | 107 | else |
102 | flush = VIVS_GL_FLUSH_CACHE_PE2D; | 108 | flush = VIVS_GL_FLUSH_CACHE_PE2D; |
103 | 109 | ||
104 | stall = VIVS_GL_SEMAPHORE_TOKEN_FROM(SYNC_RECIPIENT_FE) | | ||
105 | VIVS_GL_SEMAPHORE_TOKEN_TO(SYNC_RECIPIENT_PE); | ||
106 | |||
107 | CMD_LOAD_STATE(buffer, VIVS_GL_FLUSH_CACHE, flush); | 110 | CMD_LOAD_STATE(buffer, VIVS_GL_FLUSH_CACHE, flush); |
108 | CMD_LOAD_STATE(buffer, VIVS_GL_SEMAPHORE_TOKEN, stall); | 111 | CMD_SEM(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_PE); |
109 | |||
110 | CMD_STALL(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_PE); | 112 | CMD_STALL(buffer, SYNC_RECIPIENT_FE, SYNC_RECIPIENT_PE); |
111 | 113 | ||
112 | CMD_LOAD_STATE(buffer, VIVS_GL_PIPE_SELECT, | 114 | CMD_LOAD_STATE(buffer, VIVS_GL_PIPE_SELECT, |