0001-pixmap-fix-reverse-optimus-support-with-multiple-hea.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. From 4b281c11423b7bac8f0265e650a3e7ff890081bc Mon Sep 17 00:00:00 2001
  2. From: Dave Airlie <airlied@gmail.com>
  3. Date: Tue, 30 Jul 2013 13:48:04 +1000
  4. Subject: [PATCH] pixmap: fix reverse optimus support with multiple heads
  5. For doing reverese optimus to multiple outputs on a secondary GPU
  6. the GPU can store the blits into a large screen pixmap, unfortunately
  7. this means we need a destination offset into the dirty code, so
  8. add a new API that just adds this interface.
  9. Signed-off-by: Dave Airlie <airlied@redhat.com>
  10. ---
  11. dix/pixmap.c | 18 ++++++++++++++----
  12. include/pixmap.h | 6 ++++++
  13. include/pixmapstr.h | 1 +
  14. 3 files changed, 21 insertions(+), 4 deletions(-)
  15. diff --git a/dix/pixmap.c b/dix/pixmap.c
  16. index fe92147..e01d961 100644
  17. --- a/dix/pixmap.c
  18. +++ b/dix/pixmap.c
  19. @@ -164,9 +164,9 @@ PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave)
  20. }
  21. Bool
  22. -PixmapStartDirtyTracking(PixmapPtr src,
  23. - PixmapPtr slave_dst,
  24. - int x, int y)
  25. +PixmapStartDirtyTracking2(PixmapPtr src,
  26. + PixmapPtr slave_dst,
  27. + int x, int y, int dst_x, int dst_y)
  28. {
  29. ScreenPtr screen = src->drawable.pScreen;
  30. PixmapDirtyUpdatePtr dirty_update;
  31. @@ -179,6 +179,8 @@ PixmapStartDirtyTracking(PixmapPtr src,
  32. dirty_update->slave_dst = slave_dst;
  33. dirty_update->x = x;
  34. dirty_update->y = y;
  35. + dirty_update->dst_x = dst_x;
  36. + dirty_update->dst_y = dst_y;
  37. dirty_update->damage = DamageCreate(NULL, NULL,
  38. DamageReportNone,
  39. @@ -195,6 +197,14 @@ PixmapStartDirtyTracking(PixmapPtr src,
  40. }
  41. Bool
  42. +PixmapStartDirtyTracking(PixmapPtr src,
  43. + PixmapPtr slave_dst,
  44. + int x, int y)
  45. +{
  46. + return PixmapStartDirtyTracking2(src, slave_dst, x, y, 0, 0);
  47. +}
  48. +
  49. +Bool
  50. PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst)
  51. {
  52. ScreenPtr screen = src->drawable.pScreen;
  53. @@ -262,7 +272,7 @@ Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region)
  54. h = dst_box.y2 - dst_box.y1;
  55. pGC->ops->CopyArea(&dirty->src->drawable, &dst->drawable, pGC,
  56. - dirty->x + dst_box.x1, dirty->y + dst_box.y1, w, h, dst_box.x1, dst_box.y1);
  57. + dirty->x + dst_box.x1, dirty->y + dst_box.y1, w, h, dirty->dst_x + dst_box.x1, dirty->dst_y + dst_box.y1);
  58. b++;
  59. }
  60. FreeScratchGC(pGC);
  61. diff --git a/include/pixmap.h b/include/pixmap.h
  62. index 921a94d..d7d0a5e 100644
  63. --- a/include/pixmap.h
  64. +++ b/include/pixmap.h
  65. @@ -120,6 +120,12 @@ PixmapStartDirtyTracking(PixmapPtr src,
  66. PixmapPtr slave_dst,
  67. int x, int y);
  68. +#define HAS_DIRTYTRACKING2 1
  69. +extern _X_EXPORT Bool
  70. +PixmapStartDirtyTracking2(PixmapPtr src,
  71. + PixmapPtr slave_dst,
  72. + int x, int y, int dst_x, int dst_y);
  73. +
  74. extern _X_EXPORT Bool
  75. PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst);
  76. diff --git a/include/pixmapstr.h b/include/pixmapstr.h
  77. index 2a1ef9b..2bdff98 100644
  78. --- a/include/pixmapstr.h
  79. +++ b/include/pixmapstr.h
  80. @@ -90,6 +90,7 @@ typedef struct _PixmapDirtyUpdate {
  81. int x, y;
  82. DamagePtr damage;
  83. struct xorg_list ent;
  84. + int dst_x, dst_y;
  85. } PixmapDirtyUpdateRec;
  86. static inline void
  87. --
  88. 1.8.2.1