@@ -743,11 +743,48 @@ static void loriePerformVblanks(void) {
743
743
}
744
744
}
745
745
746
+ Bool loriePresentCheckFlip (__unused RRCrtcPtr crtc , WindowPtr window , PixmapPtr pixmap , __unused Bool sync_flip ) {
747
+ LoriePixmapPriv * priv = (LoriePixmapPriv * ) exaGetPixmapDriverPrivate (pixmap );
748
+ if (!priv || !priv -> buffer || priv -> mem )
749
+ return FALSE;
750
+
751
+ const LorieBuffer_Desc * desc = LorieBuffer_description (priv -> buffer );
752
+ if (desc -> type == LORIEBUFFER_REGULAR ) {
753
+ // Regular buffers can not be shared to activity, we must explicitly convert LorieBuffer to FD or AHardwareBuffer
754
+ int8_t type = pvfb -> root .legacyDrawing ? LORIEBUFFER_FD : LORIEBUFFER_AHARDWAREBUFFER ;
755
+ int8_t format = pvfb -> root .flip ? AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM : AHARDWAREBUFFER_FORMAT_B8G8R8A8_UNORM ;
756
+ LorieBuffer_convert (priv -> buffer , type , format );
757
+ if (desc -> type != LORIEBUFFER_REGULAR ) {
758
+ // LorieBuffer_convert does not report status but it does not let the type change in the case of error.
759
+ pScreenPtr -> ModifyPixmapHeader (pixmap , 0 , 0 , 0 , 0 , desc -> stride * 4 , NULL );
760
+ LorieBuffer_lock (priv -> buffer , & priv -> locked );
761
+ }
762
+ }
763
+
764
+ if (desc -> type != LORIEBUFFER_FD && desc -> type != LORIEBUFFER_AHARDWAREBUFFER )
765
+ return FALSE;
766
+
767
+ /* currently not implemented */
768
+ return FALSE;
769
+ }
770
+
771
+ Bool loriePresentFlip (__unused RRCrtcPtr crtc , uint64_t event_id , uint64_t target_msc , PixmapPtr pixmap , __unused Bool sync_flip ) {
772
+ /* currently not implemented */
773
+ return FALSE;
774
+ }
775
+
776
+ void loriePresentUnflip (__unused ScreenPtr screen , uint64_t event_id ) {
777
+ /* currently not implemented */
778
+ }
779
+
746
780
static struct present_screen_info loriePresentInfo = {
747
781
.get_crtc = loriePresentGetCrtc ,
748
782
.get_ust_msc = loriePresentGetUstMsc ,
749
783
.queue_vblank = loriePresentQueueVblank ,
750
784
.abort_vblank = loriePresentAbortVblank ,
785
+ .check_flip = loriePresentCheckFlip ,
786
+ .flip = loriePresentFlip ,
787
+ .unflip = loriePresentUnflip ,
751
788
};
752
789
753
790
void exaDDXDriverInit (__unused ScreenPtr pScreen ) {}
0 commit comments