File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
drivers/gpu/drm/nouveau/nvkm/subdev/gsp Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ r535_gsp_cmdq_push(struct nvkm_gsp *gsp, void *argv)
161
161
u64 * end ;
162
162
u64 csum = 0 ;
163
163
int free , time = 1000000 ;
164
- u32 wptr , size ;
164
+ u32 wptr , size , step ;
165
165
u32 off = 0 ;
166
166
167
167
argc = ALIGN (GSP_MSG_HDR_SIZE + argc , GSP_PAGE_SIZE );
@@ -195,7 +195,9 @@ r535_gsp_cmdq_push(struct nvkm_gsp *gsp, void *argv)
195
195
}
196
196
197
197
cqe = (void * )((u8 * )gsp -> shm .cmdq .ptr + 0x1000 + wptr * 0x1000 );
198
- size = min_t (u32 , argc , (gsp -> cmdq .cnt - wptr ) * GSP_PAGE_SIZE );
198
+ step = min_t (u32 , free , (gsp -> cmdq .cnt - wptr ));
199
+ size = min_t (u32 , argc , step * GSP_PAGE_SIZE );
200
+
199
201
memcpy (cqe , (u8 * )cmd + off , size );
200
202
201
203
wptr += DIV_ROUND_UP (size , 0x1000 );
You can’t perform that action at this time.
0 commit comments