DRI2: Avoid call to NULL pointer
DDX driver may implement schedule swap without GetMSC. In that case we can't call GetMSC in DRI2SwapBuffers. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> CC: Keith Packard <keithp@keithp.com> CC: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
a52efb096e
commit
383dfe23f1
|
@ -828,11 +828,14 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
|
||||||
* is moved to a crtc with a lower refresh rate, or a crtc that just
|
* is moved to a crtc with a lower refresh rate, or a crtc that just
|
||||||
* got enabled.
|
* got enabled.
|
||||||
*/
|
*/
|
||||||
if (!(*ds->GetMSC)(pDraw, &ust, ¤t_msc))
|
if (ds->GetMSC) {
|
||||||
pPriv->last_swap_target = 0;
|
if (!(*ds->GetMSC)(pDraw, &ust, ¤t_msc))
|
||||||
|
pPriv->last_swap_target = 0;
|
||||||
|
|
||||||
if (current_msc < pPriv->last_swap_target)
|
if (current_msc < pPriv->last_swap_target)
|
||||||
pPriv->last_swap_target = current_msc;
|
pPriv->last_swap_target = current_msc;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Swap target for this swap is last swap target + swap interval since
|
* Swap target for this swap is last swap target + swap interval since
|
||||||
|
|
Loading…
Reference in New Issue
Block a user