mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 14:14:37 +00:00
drm: mali-dp: use div_u64 for expensive 64-bit divisions
On 32-bit machines, we can't divide 64-bit integers: drivers/gpu/drm/arm/malidp_crtc.o: In function `malidp_crtc_atomic_check': malidp_crtc.c:(.text.malidp_crtc_atomic_check+0x3c0): undefined reference to `__aeabi_uldivmod' malidp_crtc.c:(.text.malidp_crtc_atomic_check+0x3dc): undefined reference to `__aeabi_uldivmod' This calls the div_u64 function explicitly instead. Fixes: 4cea4e9f6690 ("drm: mali-dp: Add plane upscaling support") Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
parent
c2e7f82d33
commit
763656d30b
1 changed files with 4 additions and 5 deletions
|
@ -266,7 +266,6 @@ static int malidp_crtc_atomic_check_scaling(struct drm_crtc *crtc,
|
||||||
|
|
||||||
drm_atomic_crtc_state_for_each_plane_state(plane, pstate, state) {
|
drm_atomic_crtc_state_for_each_plane_state(plane, pstate, state) {
|
||||||
struct malidp_plane *mp = to_malidp_plane(plane);
|
struct malidp_plane *mp = to_malidp_plane(plane);
|
||||||
u64 crtc_w, crtc_h;
|
|
||||||
u32 phase;
|
u32 phase;
|
||||||
|
|
||||||
if (!(mp->layer->id & scaling))
|
if (!(mp->layer->id & scaling))
|
||||||
|
@ -276,10 +275,10 @@ static int malidp_crtc_atomic_check_scaling(struct drm_crtc *crtc,
|
||||||
* Convert crtc_[w|h] to U32.32, then divide by U16.16 src_[w|h]
|
* Convert crtc_[w|h] to U32.32, then divide by U16.16 src_[w|h]
|
||||||
* to get the U16.16 result.
|
* to get the U16.16 result.
|
||||||
*/
|
*/
|
||||||
crtc_w = (u64)pstate->crtc_w << 32;
|
h_upscale_factor = div_u64((u64)pstate->crtc_w << 32,
|
||||||
crtc_h = (u64)pstate->crtc_h << 32;
|
pstate->src_w);
|
||||||
h_upscale_factor = (u32)(crtc_w / pstate->src_w);
|
v_upscale_factor = div_u64((u64)pstate->crtc_h << 32,
|
||||||
v_upscale_factor = (u32)(crtc_h / pstate->src_h);
|
pstate->src_h);
|
||||||
|
|
||||||
s->enhancer_enable = ((h_upscale_factor >> 16) >= 2 ||
|
s->enhancer_enable = ((h_upscale_factor >> 16) >= 2 ||
|
||||||
(v_upscale_factor >> 16) >= 2);
|
(v_upscale_factor >> 16) >= 2);
|
||||||
|
|
Loading…
Reference in a new issue