Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add deepin patches #10

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions backend/drm/drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ static bool drm_crtc_commit(struct wlr_drm_connector *conn,
if (state->primary_fb != NULL) {
crtc->primary->queued_fb = drm_fb_lock(state->primary_fb);
}
if (crtc->cursor != NULL) {
if (crtc->cursor != NULL && conn->cursor_pending_fb != NULL) {
drm_fb_move(&crtc->cursor->queued_fb, &conn->cursor_pending_fb);
}

Expand All @@ -463,6 +463,10 @@ static bool drm_crtc_commit(struct wlr_drm_connector *conn,
}

drm_connector_set_pending_page_flip(conn, page_flip);

if (state->base->committed & WLR_OUTPUT_STATE_MODE) {
conn->refresh = calculate_refresh_rate(&state->mode);
}
} else {
// The set_cursor() hook is a bit special: it's not really synchronized
// to commit() or test(). Once set_cursor() returns true, the new
Expand Down Expand Up @@ -1454,6 +1458,7 @@ static bool connect_drm_connector(struct wlr_drm_connector *wlr_conn,
wlr_conn->crtc->props.mode_id, &mode_id);

wlr_conn->crtc->mode_id = mode_id;
wlr_conn->refresh = calculate_refresh_rate(current_modeinfo);
}

wlr_log(WLR_INFO, " %"PRId32"x%"PRId32" @ %.3f Hz %s",
Expand Down Expand Up @@ -1753,7 +1758,7 @@ static void handle_page_flip(int fd, unsigned seq,
.presented = drm->session->active,
.when = &present_time,
.seq = seq,
.refresh = mhz_to_nsec(conn->output.refresh),
.refresh = mhz_to_nsec(conn->refresh),
.flags = present_flags,
};
wlr_output_send_present(&conn->output, &present_event);
Expand Down Expand Up @@ -1801,16 +1806,10 @@ int wlr_drm_backend_get_non_master_fd(struct wlr_backend *backend) {
assert(backend);

struct wlr_drm_backend *drm = get_drm_backend_from_backend(backend);
char *path = drmGetDeviceNameFromFd2(drm->fd);
if (!path) {
wlr_log(WLR_ERROR, "Failed to get device name from DRM fd");
return -1;
}
int fd = open(drm->name, O_RDWR | O_CLOEXEC);

int fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0) {
wlr_log_errno(WLR_ERROR, "Unable to clone DRM fd for client fd");
free(path);
return -1;
}

Expand Down
1 change: 1 addition & 0 deletions backend/drm/libliftoff.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ static bool crtc_commit(struct wlr_drm_connector *conn,
wlr_log_errno(WLR_ERROR, "Failed to destroy FB_DAMAGE_CLIPS property blob");
}
}
wl_array_release(&fb_damage_clips_arr);

return ok;
}
Expand Down
6 changes: 3 additions & 3 deletions backend/libinput/tablet_pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
++group->ring_count;
}
}
group->rings = calloc(sizeof(unsigned int), group->ring_count);
group->rings = calloc(group->ring_count, sizeof(unsigned int));
if (group->rings == NULL) {
goto group_fail;
}
Expand All @@ -50,7 +50,7 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
++group->strip_count;
}
}
group->strips = calloc(sizeof(unsigned int), group->strip_count);
group->strips = calloc(group->strip_count, sizeof(unsigned int));
if (group->strips == NULL) {
goto group_fail;
}
Expand All @@ -66,7 +66,7 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
++group->button_count;
}
}
group->buttons = calloc(sizeof(unsigned int), group->button_count);
group->buttons = calloc(group->button_count, sizeof(unsigned int));
if (group->buttons == NULL) {
goto group_fail;
}
Expand Down
32 changes: 32 additions & 0 deletions backend/x11/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ static bool output_set_custom_mode(struct wlr_output *wlr_output,
struct wlr_x11_output *output = get_x11_output_from_output(wlr_output);
struct wlr_x11_backend *x11 = output->x11;

if (width == output->win_width && height == output->win_height) {
return true;
}

const uint32_t values[] = { width, height };
xcb_void_cookie_t cookie = xcb_configure_window_checked(
x11->xcb, output->win,
Expand All @@ -77,6 +81,9 @@ static bool output_set_custom_mode(struct wlr_output *wlr_output,
return false;
}

output->win_width = width;
output->win_height = height;

// Move the pointer to its new location
update_x11_pointer_position(output, output->x11->time);

Expand Down Expand Up @@ -114,6 +121,9 @@ static void output_destroy(struct wlr_output *wlr_output) {

static bool output_test(struct wlr_output *wlr_output,
const struct wlr_output_state *state) {
struct wlr_x11_output *output = get_x11_output_from_output(wlr_output);
struct wlr_x11_backend *x11 = output->x11;

uint32_t unsupported = state->committed & ~SUPPORTED_OUTPUT_STATE;
if (unsupported != 0) {
wlr_log(WLR_DEBUG, "Unsupported output state fields: 0x%"PRIx32,
Expand All @@ -133,6 +143,22 @@ static bool output_test(struct wlr_output *wlr_output,
}
}

if (state->committed & WLR_OUTPUT_STATE_BUFFER) {
struct wlr_buffer *buffer = state->buffer;
struct wlr_dmabuf_attributes dmabuf_attrs;
struct wlr_shm_attributes shm_attrs;
uint32_t format = DRM_FORMAT_INVALID;
if (wlr_buffer_get_dmabuf(buffer, &dmabuf_attrs)) {
format = dmabuf_attrs.format;
} else if (wlr_buffer_get_shm(buffer, &shm_attrs)) {
format = shm_attrs.format;
}
if (format != x11->x11_format->drm) {
wlr_log(WLR_DEBUG, "Unsupported buffer format");
return false;
}
}

if (state->committed & WLR_OUTPUT_STATE_MODE) {
assert(state->mode_type == WLR_OUTPUT_STATE_MODE_CUSTOM);

Expand Down Expand Up @@ -579,6 +605,9 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) {
x11->screen->root, 0, 0, wlr_output->width, wlr_output->height, 0,
XCB_WINDOW_CLASS_INPUT_OUTPUT, x11->visualid, mask, values);

output->win_width = wlr_output->width;
output->win_height = wlr_output->height;

struct {
xcb_input_event_mask_t head;
xcb_input_xi_event_mask_t mask;
Expand Down Expand Up @@ -640,6 +669,9 @@ void handle_x11_configure_notify(struct wlr_x11_output *output,
return;
}

output->win_width = ev->width;
output->win_height = ev->height;

struct wlr_output_state state;
wlr_output_state_init(&state);
wlr_output_state_set_custom_mode(&state, ev->width, ev->height, 0);
Expand Down
42 changes: 20 additions & 22 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
wlroots (0.17.0-2deepin2) unstable; urgency=medium
wlroots (0.17.2-1deepin1) unstable; urgency=medium

* Release new version to reslove conflict with wlroots-git
* Add deepin patchs

-- rewine <luhongxu@deepin.org> Fri, 24 Nov 2023 20:00:00 +0800
-- xiangzelong <xiangzelong@deepin.org> Wed, 08 May 2024 16:13:15 +0800

wlroots (0.17.0-1deepin2) unstable; urgency=medium
wlroots (0.17.2-1) experimental; urgency=medium

* Remove unused patch
* Upload to experimental to not disturb ongoing transitions
* New upstream release
* [c097505] gles2: Avoid crash when glGetInteger64vEXT is missing
Backport of upstream commit 341b3c8bd2387d9d6fb684e006a4eb45dfe09efa

-- Guido Günther <[email protected]> Tue, 12 Mar 2024 19:16:00 +0100

wlroots (0.17.1-2) unstable; urgency=medium

-- rewine <[email protected]> Fri, 24 Nov 2023 17:28:54 +0800
* Upload to unstable.

wlroots (0.17.0-1deepin1) unstable; urgency=medium
-- Guido Günther <[email protected]> Tue, 09 Jan 2024 19:39:59 +0100

* Add deepin patch
wlroots (0.17.1-1) experimental; urgency=medium

-- xiangzelong <[email protected]> Fri, 24 Nov 2023 10:17:53 +0800
* New upstream release
* d/control: Drop superfluous version information
Thanks: Diederik de Haas

-- Guido Günther <[email protected]> Fri, 22 Dec 2023 15:32:00 +0100

wlroots (0.17.0-1~exp1) experimental; urgency=medium

Expand Down Expand Up @@ -48,19 +59,6 @@ wlroots (0.16.2-3) unstable; urgency=medium

-- Guido Günther <[email protected]> Thu, 03 Aug 2023 21:25:19 +0200

wlroots (0.16.2-2deepin2) unstable; urgency=medium

* Upload to unstable
* fix error dependency on debian/control

-- xiangzelong <[email protected]> Mon, 03 Jul 2023 16:25:20 +0800

wlroots (0.16.2-2deepin1) UNRELEASED; urgency=medium

* add new patch

-- xiangzelong <[email protected]> Mon, 24 Apr 2023 11:41:46 +0800

wlroots (0.16.2-2) unstable; urgency=medium

* Upload to unstable
Expand Down
16 changes: 8 additions & 8 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ Build-Depends:
libcap-dev,
libcairo2-dev,
libdisplay-info-dev (>= 0.1.1),
libdrm-dev (>= 2.4.113),
libdrm-dev (>= 2.4.114),
libegl1-mesa-dev,
libegl-dev,
libgbm-dev (>= 17.1.0),
libgbm-dev,
libgles2-mesa-dev,
libinput-dev (>= 1.9.0),
libinput-dev,
libliftoff-dev (>= 0.4.1),
libpixman-1-dev,
libpng-dev,
libseat-dev,
libsystemd-dev,
libvulkan-dev,
libwayland-dev (>= 1.21),
libwayland-dev (>= 1.22),
libx11-xcb-dev,
libxcb1-dev,
libxcb-composite0-dev,
Expand All @@ -37,9 +37,9 @@ Build-Depends:
libxcb-xfixes0-dev,
libxcb-xinput-dev,
libxkbcommon-dev,
meson (>= 0.59.0),
meson,
pkg-config,
wayland-protocols (>= 1.31),
wayland-protocols (>= 1.24),
xwayland,
Standards-Version: 4.6.2
Section: libs
Expand All @@ -59,9 +59,9 @@ Depends:
libdisplay-info-dev,
libdrm-dev (>= 2.4.114),
libegl-dev,
libgbm-dev (>= 17.1.0),
libgbm-dev,
libgles2-mesa-dev,
libinput-dev (>= 1.14.0),
libinput-dev,
libpixman-1-dev,
libseat-dev,
libsystemd-dev,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From: =?utf-8?q?Guido_G=C3=BCnther?= <[email protected]>
Date: Fri, 1 Jan 2021 13:58:55 +0100
Subject: Revert "layer-shell: error on 0 dimension without anchors"

This reverts commit 8dec751a6d84335fb04288b8efab6dd5c90288d3.

Revert this until phosh has a fixed release.
---
types/wlr_layer_shell_v1.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/types/wlr_layer_shell_v1.c b/types/wlr_layer_shell_v1.c
index 37256db..2c722a7 100644
--- a/types/wlr_layer_shell_v1.c
+++ b/types/wlr_layer_shell_v1.c
@@ -335,6 +335,7 @@ static void layer_surface_role_commit(struct wlr_surface *wlr_surface) {
return;
}

+#if 0
const uint32_t horiz = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT;
if (surface->pending.desired_width == 0 &&
@@ -354,6 +355,7 @@ static void layer_surface_role_commit(struct wlr_surface *wlr_surface) {
"height 0 requested without setting top and bottom anchors");
return;
}
+#endif

if (surface->surface->unmap_commit) {
layer_surface_reset(surface);
24 changes: 24 additions & 0 deletions debian/patches/emit-destroy-signal-in-destroy-function.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 293b0aa502d2e64d68290b1b615e9bd6d203d818 Mon Sep 17 00:00:00 2001
From: groveer <[email protected]>
Date: Mon, 6 May 2024 15:42:18 +0800
Subject: [PATCH] wlr_pointer_gestures_v1: emit destroy signal in destroy
function

---
types/wlr_pointer_gestures_v1.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/types/wlr_pointer_gestures_v1.c b/types/wlr_pointer_gestures_v1.c
index bd9e1f9eb..ebb1c8689 100644
--- a/types/wlr_pointer_gestures_v1.c
+++ b/types/wlr_pointer_gestures_v1.c
@@ -396,6 +396,7 @@ static void pointer_gestures_v1_bind(struct wl_client *wl_client, void *data,
static void handle_display_destroy(struct wl_listener *listener, void *data) {
struct wlr_pointer_gestures_v1 *gestures =
wl_container_of(listener, gestures, display_destroy);
+ wl_signal_emit_mutable(&gestures->events.destroy, NULL);
wl_list_remove(&gestures->display_destroy.link);
wl_global_destroy(gestures->global);
free(gestures);
--
GitLab
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From: =?utf-8?q?Guido_G=C3=BCnther?= <[email protected]>
Date: Tue, 12 Mar 2024 10:38:21 +0100
Subject: gles2: Avoid crash when glGetInteger64vEXT is missing

The spec for GL_EXT_disjoint_timer_query says

> The GetInteger64vEXT command is required only if OpenGL ES 3.0 or later
> is not supported.

Some GLES 3.2 implementations like the proprietary mali driver on the
rk3566 based OrangePi advertise GL_EXT_disjoint_timer_query but lack
glGetInteger64vEXT. Use glGetInteger64v instead.

(cherry picked from commit 341b3c8bd2387d9d6fb684e006a4eb45dfe09efa)
---
render/gles2/renderer.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index 4899cfc..215a5e4 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -915,7 +915,11 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
load_gl_proc(&renderer->procs.glQueryCounterEXT, "glQueryCounterEXT");
load_gl_proc(&renderer->procs.glGetQueryObjectivEXT, "glGetQueryObjectivEXT");
load_gl_proc(&renderer->procs.glGetQueryObjectui64vEXT, "glGetQueryObjectui64vEXT");
- load_gl_proc(&renderer->procs.glGetInteger64vEXT, "glGetInteger64vEXT");
+ if (eglGetProcAddress("glGetInteger64vEXT")) {
+ load_gl_proc(&renderer->procs.glGetInteger64vEXT, "glGetInteger64vEXT");
+ } else {
+ load_gl_proc(&renderer->procs.glGetInteger64vEXT, "glGetInteger64v");
+ }
}

if (renderer->exts.KHR_debug) {
24 changes: 24 additions & 0 deletions debian/patches/init-destroy-signal.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From dead0ebcc8cc0df26925b633040a39190eeb0c55 Mon Sep 17 00:00:00 2001
From: groveer <[email protected]>
Date: Mon, 6 May 2024 15:11:36 +0800
Subject: [PATCH] wlr_pointer_gestures_v1: init destroy signal

---
types/wlr_pointer_gestures_v1.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/types/wlr_pointer_gestures_v1.c b/types/wlr_pointer_gestures_v1.c
index 0763f3ac34..bd9e1f9ebd 100644
--- a/types/wlr_pointer_gestures_v1.c
+++ b/types/wlr_pointer_gestures_v1.c
@@ -420,6 +420,8 @@ struct wlr_pointer_gestures_v1 *wlr_pointer_gestures_v1_create(
return NULL;
}

+ wl_signal_init(&gestures->events.destroy);
+
gestures->display_destroy.notify = handle_display_destroy;
wl_display_add_destroy_listener(display, &gestures->display_destroy);

--
GitLab
4 changes: 4 additions & 0 deletions debian/patches/series
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Revert-layer-shell-error-on-0-dimension-without-anchors.patch
gles2-Avoid-crash-when-glGetInteger64vEXT-is-missing.patch
emit-destroy-signal-in-destroy-function.patch
init-destroy-signal.patch
Loading
Loading