ecore-drm2: Fix issue of shifting 1 by more than 32bits

Based on 9ca573f40f, this patch fixes
potential undefined behaviour on 64 bit systems.

@fix
This commit is contained in:
Chris Michael 2019-11-14 12:21:40 -05:00
parent 9ca573f40f
commit 2288c92bc5
2 changed files with 3 additions and 3 deletions

View File

@ -487,7 +487,7 @@ _drm2_atomic_state_plane_fill(Ecore_Drm2_Plane_State *pstate, int fd)
{ {
pstate->supported_rotations |= r; pstate->supported_rotations |= r;
pstate->rotation_map[ffs(r)] = pstate->rotation_map[ffs(r)] =
1 << prop->enums[k].value; 1ULL << prop->enums[k].value;
} }
} }
} }

View File

@ -659,7 +659,7 @@ _output_plane_states_get(Ecore_Drm2_Atomic_State *state, unsigned int crtc_id, i
states = states =
eina_list_append(states, _atomic_state_plane_duplicate(pstate)); eina_list_append(states, _atomic_state_plane_duplicate(pstate));
} }
else if (pstate->mask & (1 << index)) else if (pstate->mask & (1ULL << index))
{ {
states = states =
eina_list_append(states, _atomic_state_plane_duplicate(pstate)); eina_list_append(states, _atomic_state_plane_duplicate(pstate));
@ -1454,7 +1454,7 @@ ecore_drm2_output_possible_crtc_get(Ecore_Drm2_Output *output, unsigned int crtc
{ {
if (res->crtcs[k] != output->crtc_id) continue; if (res->crtcs[k] != output->crtc_id) continue;
if (p & (1 << k)) if (p & (1ULL << k))
{ {
ret = EINA_TRUE; ret = EINA_TRUE;
break; break;