mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-17 12:30:38 +01:00
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>
(cherry picked from commit 383dfe23f1)
This commit is contained in:
parent
9770500983
commit
32004e8d6e
1 changed files with 7 additions and 4 deletions
|
|
@ -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
|
||||
* got enabled.
|
||||
*/
|
||||
if (!(*ds->GetMSC)(pDraw, &ust, ¤t_msc))
|
||||
pPriv->last_swap_target = 0;
|
||||
if (ds->GetMSC) {
|
||||
if (!(*ds->GetMSC)(pDraw, &ust, ¤t_msc))
|
||||
pPriv->last_swap_target = 0;
|
||||
|
||||
if (current_msc < pPriv->last_swap_target)
|
||||
pPriv->last_swap_target = current_msc;
|
||||
if (current_msc < pPriv->last_swap_target)
|
||||
pPriv->last_swap_target = current_msc;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Swap target for this swap is last swap target + swap interval since
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue