forked from 12to11/12to11
Add support for DRM leasing and significantly rework composition code
* 12to11.c (HandleCmdline): Improve messages printed during -help. (XLMain): Initialize DRM leasing. * 12to11.man: Document changes. * Imakefile (LOCAL_LIBRARIES): Add xcb-randr, xf86drm and XPresent. (SRCS): Add drm_lease.c. (OBJS): Add drm_lease.o. * atoms.c (names): Add CONNECTOR_ID. (CONNECTOR_ID): New atom. (XLInitAtoms): Intern CONNECTOR_ID. * compositor.h (struct _RenderFuncs): Require event mask to be passed to target_from_window. New functions `set_standard_event_mask', `present_to_window', `cancel_presentation_callback', and `cancel_presentation'. (struct _BufferFuncs): Move buffer release machinery here. (enum _FrameMode): New enum. * egl.c (TargetFromWindow, SetStandardEventMask, egl_render_funcs): Adjust functions accordingly. * frame_clock.c (struct _FrameClock): New fields `end_frame_called' and `pending_sync_value'. (HandleEndFrame, PostEndFrame, StartFrame, EndFrame): Clean up frame synchronization code. Do not end upon predicted presentation time if EndFrame was not called in time. (FreezeForValue): New function. (XLFrameClockHandleFrameEvent): Defer actually freezing until StartFrame happens. (XLFrameClockGetFrameTime): New function. * icon_surface.c (ReleaseBuffer): Use RenderWaitForIdle. (RunFrameCallbacks, AfterFrame): Pass frame clock to callbacks. Use frame time if available. (XLGetIconSurface): Require wait_for_idle to work. * output.c (change_hook): New hook. (XLHandleOneXEventForOutputs): Run hook if set. (XLOutputSetChangeFunction): New function. (XLInitRROutputs): Select for RRResourceChangeNotify if providers are supported. * picture_renderer.c (struct _PresentRecord) (struct _BufferActivityRecord, struct _IdleCallback) (struct _PictureBuffer, struct _PictureTarget) (struct _DrmFormatInfo, struct _DmaBufRecord) (struct _PresentCompletionCallback): New record structures. (all_formats, SendRoundtripMessage, FindBufferActivityRecord) (RecordBufferActivity, RunIdleCallbacks, MaybeRunIdleCallbacks) (UnlinkActivityRecord, HandleActivityEvent, InitRenderFuncs) (TargetFromDrawable, TargetFromPixmap, TargetFromWindow) (SetStandardEventMask, NoteTargetSize, PictureFromTarget) (DestroyRenderTarget, FillBoxesWithTransparency) (ServerRegionFromRegion, ClearRectangle, Composite) (FindPresentRecord, AllocateRecord, PresentToWindow) (CancelPresentationCallback, CancelPresentation) (picture_render_funcs, FindSupportedModifiers, InitDrmFormats) (PictFormatIsPresentable, BufferFromDmaBuf, FinishDmaBufRecord) (BufferFromDmaBufAsync, BufferFromShm, BufferFromSinglePixel) (FreeShmBuffer, FreeDmabufBuffer, FreeSinglePixelBuffer) (AddIdleCallback, CancelIdleCallback, IsBufferIdle) (IdleEventPredicate, WaitForIdle, SetNeedWaitForIdle) (picture_buffer_funcs, HandlePresentCompleteNotify) (HandlePresentIdleNotify, HandlePresentationEvent) (HandleOneXEventForPictureRenderer, InitPictureRenderer): Allow presenting pixmaps directly, and move buffer release tracking machinery here. * renderer.c (RenderTargetFromWindow): Update signature. (RenderPresentToWindow, RenderCancelPresentationCallback) (RenderCancelPresentation, RenderAddIdleCallback) (RegisterStaticRenderer): New wrapper functions. * run.c (HandleOneXEvent): Handle picture renderer events earlier. * seat.c (MaybeCreateCursor): Require wait_for_idle. (ReleaseBuffer): Wait for buffer to become idle on each target in the cursor ring. * subcompositor.c (struct _Subcompositor): New callback `note_frame'. (SubcompositorSetNoteFrameCallback, NoViewsAfter) (PresentCompletedCallback): New functions. (SubcompositorUpdate): Try to present the buffer if possible, and run completion callbacks. (SubcompositorFree): Free presentation key. * surface.c (XLSurfaceRunFrameCallbacksMs): New function. * text_input.c: Improve commentary. * xdg-shell.xml: Update from wayland-protocols. * xdg_surface.c (struct _XdgRole): New fields `pending_frame', `last_specified_serial'. (struct _ReleaseLaterRecord): Replace free function with idle callback key and xdg role pointers. (RemoveRecord): Delete function. (FreeRecords): Stop cancelling buffer destroy listener. (ReleaseLaterExtBufferFunc): Delete function. (RunFrameCallbacks): Use frame clock time if it is set. (HandleReleaseLaterMessage): Delete function. (BufferIdleCallback): New function. (ReleaseLater): Delete function. (XLHandleXEventForXdgSurfaces): Stop handling buffer release events here. (AckConfigure): Improve debug code and reject duplicate serials. (Commit): Unfreeze earlier; also, in general... (NoteFrame): Move frame handling implementation here. (ReleaseBuffer, Subframe, EndSubframe, AfterFrame, ResizeForMap) (SelectExtraEvents): Set standard event mask. (XLGetXdgSurface, XLXdgRoleSendConfigure): ...Replace frame clock logic with that in NoteFrame.
This commit is contained in:
parent
de26ffa123
commit
713eb811ea
18 changed files with 2046 additions and 311 deletions
10
Imakefile
10
Imakefile
|
@ -1,4 +1,4 @@
|
|||
#include "libraries.def"
|
||||
#include "12to11.conf"
|
||||
|
||||
#ifndef HasPosixThreads
|
||||
#error "Posix threads are required"
|
||||
|
@ -10,7 +10,8 @@ DEPLIBS = $(DEPXLIB) $(DEPEXTENSIONLIB) $(DEPXRANDRLIB) $(DEPXRENDERLIB) \
|
|||
|
||||
LOCAL_LIBRARIES = $(XLIB) $(EXTENSIONLIB) $(XCBLIB) $(XCB) $(XCB_SHM) \
|
||||
$(XRANDRLIB) $(PIXMAN) $(XRENDERLIB) $(XILIB) $(XKBFILELIB) $(XFIXESLIB) \
|
||||
$(XCB_DRI3) $(XCB_SHAPE) $(WAYLAND_SERVER)
|
||||
$(XCB_DRI3) $(XCB_SHAPE) $(WAYLAND_SERVER) $(XCB_RANDR) $(DRM) \
|
||||
$(XPRESENTLIB)
|
||||
|
||||
INCLUDES := $(DRMINCLUDES) $(PIXMANINCLUDES)
|
||||
|
||||
|
@ -22,7 +23,7 @@ SRCS = 12to11.c run.c alloc.c fns.c output.c compositor.c \
|
|||
icon_surface.c primary_selection.c renderer.c \
|
||||
picture_renderer.c explicit_synchronization.c transform.c \
|
||||
wp_viewporter.c decoration.c text_input.c \
|
||||
single_pixel_buffer.c
|
||||
single_pixel_buffer.c drm_lease.c
|
||||
|
||||
OBJS = 12to11.o run.o alloc.o fns.o output.o compositor.o \
|
||||
surface.o region.o shm.o atoms.o subcompositor.o positioner.o \
|
||||
|
@ -32,7 +33,7 @@ OBJS = 12to11.o run.o alloc.o fns.o output.o compositor.o \
|
|||
icon_surface.o primary_selection.o renderer.o \
|
||||
picture_renderer.o explicit_synchronization.o transform.o \
|
||||
wp_viewporter.o decoration.o text_input.o \
|
||||
single_pixel_buffer.o
|
||||
single_pixel_buffer.o drm_lease.o
|
||||
|
||||
GENHEADERS = transfer_atoms.h
|
||||
|
||||
|
@ -115,6 +116,7 @@ ScannerTarget(viewporter)
|
|||
ScannerTarget(xdg-decoration-unstable-v1)
|
||||
ScannerTarget(text-input-unstable-v3)
|
||||
ScannerTarget(single-pixel-buffer-v1)
|
||||
ScannerTarget(drm-lease-v1)
|
||||
|
||||
/* Make OBJS depend on scanner headers, and depend on both them and SRCS. */
|
||||
$(OBJS): $(GENHEADERS)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue