* [PATCH] drm/amdgpu/display: Use u64 divide macro for round up division
@ 2020-01-13 13:20 mikita.lipski
2020-01-13 16:47 ` Harry Wentland
2020-01-13 17:07 ` Ville Syrjälä
0 siblings, 2 replies; 4+ messages in thread
From: mikita.lipski @ 2020-01-13 13:20 UTC (permalink / raw)
To: rdunlap, Alexander.Deucher, amd-gfx
Cc: Mikita Lipski, Harry.Wentland, dri-devel
From: Mikita Lipski <mikita.lipski@amd.com>
[why]
Fix compilation warnings on i386 architecture:
undefined reference to `__udivdi3'
[how]
Switch DIV_ROUND_UP to DIV64_U64_ROUND_UP
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 52fb207393ef..96b391e4b3e7 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -534,7 +534,7 @@ static int kbps_to_peak_pbn(int kbps)
peak_kbps *= 1006;
peak_kbps = div_u64(peak_kbps, 1000);
- return (int) DIV_ROUND_UP(peak_kbps * 64, (54 * 8 * 1000));
+ return (int) DIV64_U64_ROUND_UP(peak_kbps * 64, (54 * 8 * 1000));
}
static void set_dsc_configs_from_fairness_vars(struct dsc_mst_fairness_params *params,
--
2.17.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu/display: Use u64 divide macro for round up division
2020-01-13 13:20 [PATCH] drm/amdgpu/display: Use u64 divide macro for round up division mikita.lipski
@ 2020-01-13 16:47 ` Harry Wentland
2020-01-13 17:07 ` Ville Syrjälä
1 sibling, 0 replies; 4+ messages in thread
From: Harry Wentland @ 2020-01-13 16:47 UTC (permalink / raw)
To: mikita.lipski, rdunlap, Alexander.Deucher, amd-gfx
Cc: Harry.Wentland, dri-devel
On 2020-01-13 8:20 a.m., mikita.lipski@amd.com wrote:
> From: Mikita Lipski <mikita.lipski@amd.com>
>
> [why]
> Fix compilation warnings on i386 architecture:
> undefined reference to `__udivdi3'
> [how]
> Switch DIV_ROUND_UP to DIV64_U64_ROUND_UP
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> index 52fb207393ef..96b391e4b3e7 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> @@ -534,7 +534,7 @@ static int kbps_to_peak_pbn(int kbps)
>
> peak_kbps *= 1006;
> peak_kbps = div_u64(peak_kbps, 1000);
> - return (int) DIV_ROUND_UP(peak_kbps * 64, (54 * 8 * 1000));
> + return (int) DIV64_U64_ROUND_UP(peak_kbps * 64, (54 * 8 * 1000));
> }
>
> static void set_dsc_configs_from_fairness_vars(struct dsc_mst_fairness_params *params,
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu/display: Use u64 divide macro for round up division
2020-01-13 13:20 [PATCH] drm/amdgpu/display: Use u64 divide macro for round up division mikita.lipski
2020-01-13 16:47 ` Harry Wentland
@ 2020-01-13 17:07 ` Ville Syrjälä
2020-01-16 4:58 ` Randy Dunlap
1 sibling, 1 reply; 4+ messages in thread
From: Ville Syrjälä @ 2020-01-13 17:07 UTC (permalink / raw)
To: mikita.lipski; +Cc: Alexander.Deucher, rdunlap, dri-devel, amd-gfx
On Mon, Jan 13, 2020 at 08:20:42AM -0500, mikita.lipski@amd.com wrote:
> From: Mikita Lipski <mikita.lipski@amd.com>
>
> [why]
> Fix compilation warnings on i386 architecture:
> undefined reference to `__udivdi3'
> [how]
> Switch DIV_ROUND_UP to DIV64_U64_ROUND_UP
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> index 52fb207393ef..96b391e4b3e7 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> @@ -534,7 +534,7 @@ static int kbps_to_peak_pbn(int kbps)
>
> peak_kbps *= 1006;
> peak_kbps = div_u64(peak_kbps, 1000);
> - return (int) DIV_ROUND_UP(peak_kbps * 64, (54 * 8 * 1000));
> + return (int) DIV64_U64_ROUND_UP(peak_kbps * 64, (54 * 8 * 1000));
DIV_ROUND_UP_ULL() would seem to suffice for this divisor.
> }
>
> static void set_dsc_configs_from_fairness_vars(struct dsc_mst_fairness_params *params,
> --
> 2.17.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu/display: Use u64 divide macro for round up division
2020-01-13 17:07 ` Ville Syrjälä
@ 2020-01-16 4:58 ` Randy Dunlap
0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2020-01-16 4:58 UTC (permalink / raw)
To: Ville Syrjälä, mikita.lipski
Cc: Alexander.Deucher, dri-devel, amd-gfx
On 1/13/20 9:07 AM, Ville Syrjälä wrote:
> On Mon, Jan 13, 2020 at 08:20:42AM -0500, mikita.lipski@amd.com wrote:
>> From: Mikita Lipski <mikita.lipski@amd.com>
>>
>> [why]
>> Fix compilation warnings on i386 architecture:
>> undefined reference to `__udivdi3'
>> [how]
>> Switch DIV_ROUND_UP to DIV64_U64_ROUND_UP
>>
>> Reported-by: Randy Dunlap <rdunlap@infradead.org>
>> Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
>> ---
>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
>> index 52fb207393ef..96b391e4b3e7 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
>> @@ -534,7 +534,7 @@ static int kbps_to_peak_pbn(int kbps)
>>
>> peak_kbps *= 1006;
>> peak_kbps = div_u64(peak_kbps, 1000);
>> - return (int) DIV_ROUND_UP(peak_kbps * 64, (54 * 8 * 1000));
>> + return (int) DIV64_U64_ROUND_UP(peak_kbps * 64, (54 * 8 * 1000));
that builds fine.
> DIV_ROUND_UP_ULL() would seem to suffice for this divisor.
and so does that one.
Thanks.
For either patch:
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
>> }
>>
>> static void set_dsc_configs_from_fairness_vars(struct dsc_mst_fairness_params *params,
>> --
--
~Randy
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-01-16 8:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 13:20 [PATCH] drm/amdgpu/display: Use u64 divide macro for round up division mikita.lipski
2020-01-13 16:47 ` Harry Wentland
2020-01-13 17:07 ` Ville Syrjälä
2020-01-16 4:58 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).