[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a02ce536-0f45-212d-cb97-ae6aae6c567c@amd.com>
Date: Thu, 6 Oct 2022 12:25:05 -0400
From: Hamza Mahfooz <hamza.mahfooz@....com>
To: Stephen Rothwell <sfr@...b.auug.org.au>,
David Airlie <airlied@...hat.com>
Cc: Alex Deucher <alexdeucher@...il.com>,
Mark Brown <broonie@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
DRI <dri-devel@...ts.freedesktop.org>,
Linux Next Mailing List <linux-next@...r.kernel.org>,
Aurabindo Pillai <aurabindo.pillai@....com>,
Alex Deucher <alexander.deucher@....com>
Subject: Re: linux-next: build failure after merge of the drm tree
On 2022-10-06 04:12, Stephen Rothwell wrote:
> Hi all,
>
> On Thu, 6 Oct 2022 09:28:10 +1100 Stephen Rothwell <sfr@...b.auug.org.au> wrote:
>>
>> I have applied the following hack for today:
>>
>> From: Stephen Rothwell <sfr@...b.auug.org.au>
>> Date: Thu, 6 Oct 2022 09:14:26 +1100
>> Subject: [PATCH] fix up for drivers/gpu/drm/amd/display/dc/core/dc_stream.c
>>
>> Signed-off-by: Stephen Rothwell <sfr@...b.auug.org.au>
>> ---
>> drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
>> index ae13887756bf..a5da787b7876 100644
>> --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
>> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
>> @@ -520,9 +520,9 @@ bool dc_stream_remove_writeback(struct dc *dc,
>> }
>>
>> /* remove writeback info for disabled writeback pipes from stream */
>> - for (i = 0, j = 0; i < stream->num_wb_info && j < MAX_DWB_PIPES; i++) {
>> + for (i = 0, j = 0; i < stream->num_wb_info && i < MAX_DWB_PIPES; i++) {
>> if (stream->writeback_info[i].wb_enabled) {
>> - if (i != j)
>> + if ((j >= 0) && (j < i))
>> /* trim the array */
>> stream->writeback_info[j] = stream->writeback_info[i];
>> j++;
>
> This works as well, and (in my opinion) is better:
I can confirm that this fix works on GCC 9.4, as well.
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> index ae13887756bf..fb6222d4c430 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
> @@ -499,7 +499,7 @@ bool dc_stream_remove_writeback(struct dc *dc,
> struct dc_stream_state *stream,
> uint32_t dwb_pipe_inst)
> {
> - int i = 0, j = 0;
> + unsigned int i, j;
> if (stream == NULL) {
> dm_error("DC: dc_stream is NULL!\n");
> return false;
> @@ -520,9 +520,9 @@ bool dc_stream_remove_writeback(struct dc *dc,
> }
>
> /* remove writeback info for disabled writeback pipes from stream */
> - for (i = 0, j = 0; i < stream->num_wb_info && j < MAX_DWB_PIPES; i++) {
> + for (i = 0, j = 0; i < stream->num_wb_info; i++) {
> if (stream->writeback_info[i].wb_enabled) {
> - if (i != j)
> + if (j < i)
> /* trim the array */
> stream->writeback_info[j] = stream->writeback_info[i];
> j++;
>
--
Hamza
Powered by blists - more mailing lists