mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 13:59:45 -04:00
drm/amd/display: [FW Promotion] Release 0.1.23.0
1. Fix loop counter. 2. Check whether rb->capacity is 0. Acked-by: Sun peng (Leo) Li <sunpeng.li@amd.com> Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
1e5e8d672f
commit
eac4c50211
@@ -6542,15 +6542,18 @@ static inline bool dmub_rb_full(struct dmub_rb *rb)
|
||||
static inline bool dmub_rb_push_front(struct dmub_rb *rb,
|
||||
const union dmub_rb_cmd *cmd)
|
||||
{
|
||||
uint64_t volatile *dst = (uint64_t volatile *)((uint8_t *)(rb->base_address) + rb->wrpt);
|
||||
const uint64_t *src = (const uint64_t *)cmd;
|
||||
uint8_t *dst = (uint8_t *)(rb->base_address) + rb->wrpt;
|
||||
const uint8_t *src = (const uint8_t *)cmd;
|
||||
uint8_t i;
|
||||
|
||||
if (rb->capacity == 0)
|
||||
return false;
|
||||
|
||||
if (dmub_rb_full(rb))
|
||||
return false;
|
||||
|
||||
// copying data
|
||||
for (i = 0; i < DMUB_RB_CMD_SIZE / sizeof(uint64_t); i++)
|
||||
for (i = 0; i < DMUB_RB_CMD_SIZE; i++)
|
||||
*dst++ = *src++;
|
||||
|
||||
rb->wrpt += DMUB_RB_CMD_SIZE;
|
||||
@@ -6575,6 +6578,9 @@ static inline bool dmub_rb_out_push_front(struct dmub_rb *rb,
|
||||
uint8_t *dst = (uint8_t *)(rb->base_address) + rb->wrpt;
|
||||
const uint8_t *src = (const uint8_t *)cmd;
|
||||
|
||||
if (rb->capacity == 0)
|
||||
return false;
|
||||
|
||||
if (dmub_rb_full(rb))
|
||||
return false;
|
||||
|
||||
@@ -6620,6 +6626,9 @@ static inline void dmub_rb_get_rptr_with_offset(struct dmub_rb *rb,
|
||||
uint32_t num_cmds,
|
||||
uint32_t *next_rptr)
|
||||
{
|
||||
if (rb->capacity == 0)
|
||||
return;
|
||||
|
||||
*next_rptr = rb->rptr + DMUB_RB_CMD_SIZE * num_cmds;
|
||||
|
||||
if (*next_rptr >= rb->capacity)
|
||||
@@ -6683,6 +6692,9 @@ static inline bool dmub_rb_out_front(struct dmub_rb *rb,
|
||||
*/
|
||||
static inline bool dmub_rb_pop_front(struct dmub_rb *rb)
|
||||
{
|
||||
if (rb->capacity == 0)
|
||||
return false;
|
||||
|
||||
if (dmub_rb_empty(rb))
|
||||
return false;
|
||||
|
||||
@@ -6707,6 +6719,9 @@ static inline void dmub_rb_flush_pending(const struct dmub_rb *rb)
|
||||
uint32_t rptr = rb->rptr;
|
||||
uint32_t wptr = rb->wrpt;
|
||||
|
||||
if (rb->capacity == 0)
|
||||
return;
|
||||
|
||||
while (rptr != wptr) {
|
||||
uint64_t *data = (uint64_t *)((uint8_t *)(rb->base_address) + rptr);
|
||||
uint8_t i;
|
||||
|
||||
Reference in New Issue
Block a user