Skip to content

Commit

Permalink
Server: Improve DRI3 implementation
Browse files Browse the repository at this point in the history
(based on the implementation in TigerVNC 1.14 beta)

- Synchronize pixels between DRI3 pixmaps and their corresponding GBM
  buffer objects on an as-needed basis, in response to specific X11
  operations rather than on a schedule.

- Implement the simpler DRI3 v1 interface rather than DRI3 v2.  This
  avoids the need to implement the get_formats(), get_modifiers(), and
  get_drawable_modifiers() methods.

- Use Pixman (which is SIMD-accelerated) to synchronize pixels.

- Hook the DestroyPixmap() screen method to clean up a pixmap's
  corresponding GBM buffer object if there are no more references to the
  pixmap.

- Hook the CloseScreen() screen method to clean up the GBM device and
  close the DRM render node.

To do:

- Synchronize only the pixels that have changed.

Known issues:

TigerVNC/tigervnc#1772
  • Loading branch information
dcommander committed Jul 12, 2024
1 parent dd8aaa9 commit f9484d2
Show file tree
Hide file tree
Showing 7 changed files with 655 additions and 312 deletions.
10 changes: 0 additions & 10 deletions unix/Xvnc/programs/Xserver/damageext/damageext.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/*
* Copyright © 2002 Keith Packard
* Copyright 2013 Red Hat, Inc.
* Copyright © 2023 Kasm
* Copyright © 2024 D. R. Commander
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
Expand Down Expand Up @@ -32,10 +30,6 @@
#include "protocol-versions.h"
#include "extinit.h"

#if defined(DRI3) && defined(TURBOVNC)
extern void xvnc_dri3_sync_pixmaps_to_bos(void);
#endif

#ifdef PANORAMIX
#include "panoramiX.h"
#include "panoramiXsrv.h"
Expand Down Expand Up @@ -103,10 +97,6 @@ DamageExtNotify(DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes)

damageGetGeometry(pDrawable, &x, &y, &w, &h);

#if defined(DRI3) && defined(TURBOVNC)
xvnc_dri3_sync_pixmaps_to_bos();
#endif

UpdateCurrentTimeIf();
ev = (xDamageNotifyEvent) {
.type = DamageEventBase + XDamageNotify,
Expand Down
Loading

0 comments on commit f9484d2

Please sign in to comment.