mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-18 06:59:44 -05:00
Multi-GPU DRM
This commit is contained in:
parent
fa3d0ed929
commit
009c3747a8
11 changed files with 184 additions and 14 deletions
|
|
@ -26,6 +26,7 @@ struct wlr_drm_plane {
|
|||
uint32_t possible_crtcs;
|
||||
|
||||
struct wlr_drm_surface surf;
|
||||
struct wlr_drm_surface mgpu_surf;
|
||||
|
||||
// Only used by cursor
|
||||
float matrix[16];
|
||||
|
|
@ -58,6 +59,7 @@ struct wlr_drm_crtc {
|
|||
struct wlr_drm_backend {
|
||||
struct wlr_backend backend;
|
||||
|
||||
struct wlr_drm_backend *parent;
|
||||
const struct wlr_drm_interface *iface;
|
||||
|
||||
int fd;
|
||||
|
|
|
|||
|
|
@ -7,10 +7,16 @@
|
|||
#include <EGL/egl.h>
|
||||
#include <gbm.h>
|
||||
|
||||
#include <wlr/render.h>
|
||||
|
||||
struct wlr_drm_plane;
|
||||
|
||||
struct wlr_drm_renderer {
|
||||
int fd;
|
||||
struct gbm_device *gbm;
|
||||
struct wlr_egl egl;
|
||||
|
||||
struct wlr_renderer *wlr_rend;
|
||||
};
|
||||
|
||||
struct wlr_drm_surface {
|
||||
|
|
@ -33,9 +39,14 @@ bool wlr_drm_surface_init(struct wlr_drm_surface *surf,
|
|||
struct wlr_drm_renderer *renderer, uint32_t width, uint32_t height,
|
||||
uint32_t format, uint32_t flags);
|
||||
|
||||
bool wlr_drm_plane_surfaces_init(struct wlr_drm_plane *plane, struct wlr_drm_backend *drm,
|
||||
int32_t width, uint32_t height, uint32_t format);
|
||||
|
||||
void wlr_drm_surface_finish(struct wlr_drm_surface *surf);
|
||||
void wlr_drm_surface_make_current(struct wlr_drm_surface *surf);
|
||||
struct gbm_bo *wlr_drm_surface_swap_buffers(struct wlr_drm_surface *surf);
|
||||
struct gbm_bo *wlr_drm_surface_get_front(struct wlr_drm_surface *surf);
|
||||
void wlr_drm_surface_post(struct wlr_drm_surface *surf);
|
||||
struct gbm_bo *wlr_drm_surface_mgpu_copy(struct wlr_drm_surface *dest, struct gbm_bo *src);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include <wlr/backend.h>
|
||||
|
||||
struct wlr_backend *wlr_drm_backend_create(struct wl_display *display,
|
||||
struct wlr_session *session, int gpu_fd);
|
||||
struct wlr_session *session, int gpu_fd, struct wlr_backend *parent);
|
||||
|
||||
bool wlr_backend_is_drm(struct wlr_backend *backend);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
#define WLR_RENDER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include <wayland-server-protocol.h>
|
||||
#include <wlr/types/wlr_output.h>
|
||||
|
||||
|
|
@ -93,8 +95,11 @@ bool wlr_texture_upload_shm(struct wlr_texture *tex, uint32_t format,
|
|||
* texture. The wl_resource is not used after this call.
|
||||
* Will fail (return false) if the given resource is no drm buffer.
|
||||
*/
|
||||
bool wlr_texture_upload_drm(struct wlr_texture *tex,
|
||||
struct wl_resource *drm_buffer);
|
||||
bool wlr_texture_upload_drm(struct wlr_texture *tex,
|
||||
struct wl_resource *drm_buffer);
|
||||
|
||||
bool wlr_texture_upload_eglimage(struct wlr_texture *tex,
|
||||
EGLImageKHR image, uint32_t width, uint32_t height);
|
||||
|
||||
/**
|
||||
* Copies a rectangle of pixels from a wl_shm_buffer onto the texture. The
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
#define WLR_RENDER_INTERFACE_H
|
||||
|
||||
#include <wayland-server-protocol.h>
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include <stdbool.h>
|
||||
#include <wlr/render.h>
|
||||
#include <wlr/types/wlr_output.h>
|
||||
|
|
@ -45,6 +47,8 @@ struct wlr_texture_impl {
|
|||
int x, int y, int width, int height, struct wl_shm_buffer *shm);
|
||||
bool (*upload_drm)(struct wlr_texture *texture,
|
||||
struct wl_resource *drm_buf);
|
||||
bool (*upload_eglimage)(struct wlr_texture *texture, EGLImageKHR image,
|
||||
uint32_t width, uint32_t height);
|
||||
void (*get_matrix)(struct wlr_texture *state,
|
||||
float (*matrix)[16], const float (*projection)[16], int x, int y);
|
||||
void (*get_buffer_size)(struct wlr_texture *texture,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue