I found out I'd like to do a replacement API for egl and dispmanx. The API of firmware is molded to follow the APIs they implement, so it's an apparent roadblock that I don't have access to that firmware.
Code: Select all
/* display_id would be retrievable from udev. * Any layer could be attached to any display device or detached from it. */ GetDisplay(display_id) -> display DiscardDisplay(display) AttachLayer(display, layer, x, y, width, height, z) DetachLayer(display, layer) /* Layers would be resizable handles. */ CreateLayer(width, height) -> layer ResizeLayer(layer, width, height) DiscardLayer(layer) /* Layers could be shared between processes. */ GetLayer(layer_id) -> layer LayerId(layer) -> layer_id LayerAccess(pid, flags) // flags: READ_FLAG | DRAW_FLAG /* Surfaces would use those handles and things drawn to them would go to the layer. */ GetSurface(layer, attributes) -> surface DiscardSurface(surface) SwapBuffers(surface) /* For context it'd be enough to know which API is in use. */ CreateContext(api) -> context MakeCurrent(draw, read, context) GetCurrent() -> (draw, read, context) DestroyContext(context) /* Layers could be used as textures. */ GetImage(layer) -> image DiscardImage(image) -> image