diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-03-03 17:21:55 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-09-19 19:24:42 +0300 |
commit | 581ddc5d2f55efa2cf5ec76a802fb781ee142b01 (patch) | |
tree | 77d8dd1397ddd7918ba033c1694f3c232925ae25 | |
parent | bfeeae4de951712e9e00f681d582c6bd7f40dcd6 (diff) |
sna: Fix compiler warnings due to DrawablePtr vs. PixmapPtr
Deal with xserver commit 8e3b26ceaa86 ("Make PixmapDirtyUpdateRec::src
a DrawablePtr")
Not sure this is still correct though. Is this stuff limited to
pixmaps anymore?
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-rw-r--r-- | src/sna/sna_accel.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 8266e86d..fa386ff6 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -17518,7 +17518,11 @@ static bool has_offload_slaves(struct sna *sna) PixmapDirtyUpdatePtr dirty; xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) { +#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC + assert(dirty->src == &sna->front->drawable); +#else assert(dirty->src == sna->front); +#endif if (RegionNotEmpty(DamageRegion(dirty->damage))) return true; } @@ -17679,7 +17683,11 @@ static void sna_accel_post_damage(struct sna *sna) if (RegionNil(damage)) continue; - src = dirty->src; +#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC + assert(dirty->src->type == DRAWABLE_PIXMAP); +#endif + + src = (PixmapPtr)dirty->src; dst = dirty->slave_dst->master_pixmap; region.extents.x1 = dirty->x; @@ -17930,9 +17938,15 @@ migrate_dirty_tracking(PixmapPtr old_front, PixmapPtr new_front) PixmapDirtyUpdatePtr dirty, safe; xorg_list_for_each_entry_safe(dirty, safe, &screen->pixmap_dirty_list, ent) { +#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC + assert(dirty->src == &old_front->drawable); + if (dirty->src != &old_front->drawable) + continue; +#else assert(dirty->src == old_front); if (dirty->src != old_front) continue; +#endif DamageUnregister(&dirty->src->drawable, dirty->damage); DamageDestroy(dirty->damage); @@ -17947,7 +17961,11 @@ migrate_dirty_tracking(PixmapPtr old_front, PixmapPtr new_front) } DamageRegister(&new_front->drawable, dirty->damage); +#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC + dirty->src = &new_front->drawable; +#else dirty->src = new_front; +#endif } #endif } |