mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-11 05:34:26 -04:00
add back in 10 DRM format to drm.c
This commit is contained in:
parent
3576eec3cf
commit
aed3c173fc
1 changed files with 12 additions and 3 deletions
|
|
@ -373,6 +373,8 @@ static uint32_t strip_alpha_channel(uint32_t format) {
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case DRM_FORMAT_ARGB8888:
|
case DRM_FORMAT_ARGB8888:
|
||||||
return DRM_FORMAT_XRGB8888;
|
return DRM_FORMAT_XRGB8888;
|
||||||
|
case DRM_FORMAT_ARGB2101010:
|
||||||
|
return DRM_FORMAT_XRGB2101010;
|
||||||
default:
|
default:
|
||||||
return DRM_FORMAT_INVALID;
|
return DRM_FORMAT_INVALID;
|
||||||
}
|
}
|
||||||
|
|
@ -692,8 +694,9 @@ static bool drm_connector_init_renderer(struct wlr_drm_connector *conn,
|
||||||
|
|
||||||
int width = mode->wlr_mode.width;
|
int width = mode->wlr_mode.width;
|
||||||
int height = mode->wlr_mode.height;
|
int height = mode->wlr_mode.height;
|
||||||
uint32_t format = DRM_FORMAT_ARGB8888;
|
// TODO: allow this to be set from sway and other wlroots clients
|
||||||
|
//uint32_t format = DRM_FORMAT_ARGB8888;
|
||||||
|
uint32_t format = DRM_FORMAT_XRGB2101010;
|
||||||
bool modifiers = true;
|
bool modifiers = true;
|
||||||
const char *no_modifiers = getenv("WLR_DRM_NO_MODIFIERS");
|
const char *no_modifiers = getenv("WLR_DRM_NO_MODIFIERS");
|
||||||
if (no_modifiers != NULL && strcmp(no_modifiers, "1") == 0) {
|
if (no_modifiers != NULL && strcmp(no_modifiers, "1") == 0) {
|
||||||
|
|
@ -874,10 +877,16 @@ static bool drm_connector_set_cursor(struct wlr_output *output,
|
||||||
ret = drmGetCap(drm->fd, DRM_CAP_CURSOR_HEIGHT, &h);
|
ret = drmGetCap(drm->fd, DRM_CAP_CURSOR_HEIGHT, &h);
|
||||||
h = ret ? 64 : h;
|
h = ret ? 64 : h;
|
||||||
|
|
||||||
if (!drm_plane_init_surface(plane, drm, w, h,
|
// TODO: allow DRM format to be set from sway and other wlroots clients
|
||||||
|
/*if (!drm_plane_init_surface(plane, drm, w, h,
|
||||||
DRM_FORMAT_ARGB8888, true, false)) {
|
DRM_FORMAT_ARGB8888, true, false)) {
|
||||||
wlr_drm_conn_log(conn, WLR_ERROR, "Cannot allocate cursor resources");
|
wlr_drm_conn_log(conn, WLR_ERROR, "Cannot allocate cursor resources");
|
||||||
return false;
|
return false;
|
||||||
|
}*/
|
||||||
|
if (!drm_plane_init_surface(plane, drm, w, h,
|
||||||
|
DRM_FORMAT_ARGB2101010, true, false)) {
|
||||||
|
wlr_drm_conn_log(conn, WLR_ERROR, "Cannot allocate cursor resources");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue