Merge pull request #182 from ascent12/drm-multi-gpu

DRM Multi-GPU
This commit is contained in:
Drew DeVault 2017-10-02 08:46:06 -04:00 committed by GitHub
commit 87a0cb7ba3
22 changed files with 974 additions and 737 deletions

View file

@ -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);

View file

@ -72,12 +72,13 @@ int wlr_session_open_file(struct wlr_session *session, const char *path);
void wlr_session_close_file(struct wlr_session *session, int fd);
void wlr_session_signal_add(struct wlr_session *session, int fd,
struct wl_listener *listener);
struct wl_listener *listener);
/*
* Changes the virtual terminal.
*/
bool wlr_session_change_vt(struct wlr_session *session, unsigned vt);
int wlr_session_find_gpu(struct wlr_session *session);
size_t wlr_session_find_gpus(struct wlr_session *session,
size_t ret_len, int ret[static ret_len]);
#endif

View file

@ -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

View file

@ -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,