Compare commits

...

4 Commits

Author SHA1 Message Date
Jordan Williams
d3d99d3471 Merge branch 'fix-static-wayland' into 'main'
Rename os_create_anonymous_file to weston_os_create_anonymous_file

Closes #884

See merge request wayland/weston!1472
2024-06-26 10:40:32 +00:00
Daniel Stone
de669aeb60 doc: Tie Sphinx -W to Werror configuration
Only pass -W (warnings are fatal) to Sphinx if we've set Werror in
Meson.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Closes: wayland/weston#917
2024-06-25 17:45:37 +00:00
Michael Olbrich
f843ba34d1 drm-backend: limit reset/restart to output of a failed commit
When a commit fails, then only the outputs that where part of this commit should
be reset or restarted.

Otherwise an unrelated output that has another successful pending commit may be
restarted incorrectly. Then the output is in an inconsistent state and will
trigger an assertion:

weston: ../libweston/backend-drm/state-propose.c:627: drm_output_propose_state: Assertion `!output->state_last' failed.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2024-06-21 21:39:32 +02:00
Jordan Williams
81a1b99e2c
Rename os_create_anonymous_file to weston_os_create_anonymous_file
This avoids a conflict with the os_create_anonymous_file function in wayland-cursor.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2024-03-04 10:22:23 -06:00
20 changed files with 34 additions and 28 deletions

View File

@ -621,7 +621,7 @@ static int
shm_pool_init(struct shm_pool *pool, size_t size, struct wl_shm *wl_shm)
{
size_t pool_size = size * ARRAY_LENGTH(pool->buffers);
int fd = os_create_anonymous_file(pool_size);
int fd = weston_os_create_anonymous_file(pool_size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %zu B failed: %s\n",

View File

@ -805,7 +805,7 @@ createShmBuffer(struct wlContextStruct *p_wlCtx)
size = stride * height;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View File

@ -102,7 +102,7 @@ attach_buffer(struct window *window, int width, int height)
stride = width * 4;
size = stride * height;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View File

@ -143,7 +143,7 @@ create_shm_buffers(struct display *display, struct buffer **buffers,
stride = width * 4;
size = stride * height * num_buffers;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View File

@ -112,7 +112,7 @@ screenshot_create_shm_buffer(struct screenshooter_app *app,
assert(width == stride / bytes_pp);
assert(height == buffer->len / stride);
fd = os_create_anonymous_file(buffer->len);
fd = weston_os_create_anonymous_file(buffer->len);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %zd B failed: %s\n",
buffer->len, strerror(errno));

View File

@ -120,7 +120,7 @@ create_shm_buffer(struct display *display, struct buffer *buffer,
pitch = width * 4;
size = pitch * height;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View File

@ -165,7 +165,7 @@ create_shm_buffer(struct window *window, struct buffer *buffer, uint32_t format)
size = stride * height;
display = window->display;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View File

@ -86,7 +86,7 @@ create_shm_buffer(struct touch *touch)
stride = touch->width * 4;
size = stride * touch->height;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View File

@ -781,7 +781,7 @@ make_shm_pool(struct display *display, int size, void **data)
struct wl_shm_pool *pool;
int fd;
fd = os_create_anonymous_file(size);
fd = weston_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));

View File

@ -55,6 +55,7 @@ script_data.set('DOCTREES_DIR', meson.current_build_dir() + '/doctrees')
script_data.set('DOXYGEN_CONF', meson.current_build_dir() + '/doxygen.ini')
script_data.set('DOXYGEN_CMD', doxygen.full_path())
script_data.set('MESON_WERROR', get_option('werror') == true ? 'YES' : 'NO')
script_data.set('SPHINX_CMD', sphinx.full_path())
script_doxy_sphinx = configure_file(
input: 'run_doxygen_sphinx.sh.in',

View File

@ -1,2 +1,9 @@
#!/bin/sh
@DOXYGEN_CMD@ @DOXYGEN_CONF@ && @SPHINX_CMD@ -E -W -q -j auto -d @DOCTREES_DIR@ @SRCDIR@ @OUTDIR@
if [ "@MESON_WERROR@" = "YES" ]; then
SPHINX_WERROR="-W"
else
SPHINX_WERROR=""
fi
@DOXYGEN_CMD@ @DOXYGEN_CONF@ && @SPHINX_CMD@ $SPHINX_WERROR -E -q -j auto -d @DOCTREES_DIR@ @SRCDIR@ @OUTDIR@

View File

@ -470,9 +470,9 @@ shared_output_get_shm_buffer(struct shared_output *so)
return sb;
}
fd = os_create_anonymous_file(height * stride);
fd = weston_os_create_anonymous_file(height * stride);
if (fd < 0) {
weston_log("os_create_anonymous_file: %s\n", strerror(errno));
weston_log("weston_os_create_anonymous_file: %s\n", strerror(errno));
return NULL;
}

View File

@ -946,7 +946,7 @@ drm_repaint_flush_device(struct drm_device *device)
{
struct drm_backend *b = device->backend;
struct drm_pending_state *pending_state;
struct weston_output *base;
struct drm_output_state *output_state;
int ret;
pending_state = device->repaint_data;
@ -964,15 +964,13 @@ drm_repaint_flush_device(struct drm_device *device)
if (ret == 0)
return;
wl_list_for_each(base, &b->compositor->output_list, link) {
struct drm_output *tmp = to_drm_output(base);
if (!tmp || tmp->device != device)
continue;
wl_list_for_each(output_state, &pending_state->output_list, link) {
struct drm_output *tmp = output_state->output;
if (ret == -EBUSY)
weston_output_schedule_repaint_restart(base);
weston_output_schedule_repaint_restart(&tmp->base);
else
weston_output_schedule_repaint_reset(base);
weston_output_schedule_repaint_reset(&tmp->base);
}
}

View File

@ -330,7 +330,7 @@ wayland_output_get_shm_buffer(struct wayland_output *output)
stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width);
fd = os_create_anonymous_file(height * stride);
fd = weston_os_create_anonymous_file(height * stride);
if (fd < 0) {
weston_log("could not create an anonymous file buffer: %s\n",
strerror(errno));

View File

@ -542,7 +542,7 @@ weston_dmabuf_feedback_format_table_create(const struct weston_drm_format_array
/* Creates formats file table and mmap it */
format_table->size = weston_drm_format_array_count_pairs(renderer_formats) *
sizeof(*format_table->data);
format_table->fd = os_create_anonymous_file(format_table->size);
format_table->fd = weston_os_create_anonymous_file(format_table->size);
if (format_table->fd < 0) {
weston_log("error: failed to create format table file: %s\n",
strerror(errno));

View File

@ -180,7 +180,7 @@ create_tmpfile_cloexec(char *tmpname)
* XDG_RUNTIME_DIR.
*/
int
os_create_anonymous_file(off_t size)
weston_os_create_anonymous_file(off_t size)
{
static const char template[] = "/weston-shared-XXXXXX";
const char *path;
@ -297,7 +297,7 @@ os_ro_anonymous_file_create(size_t size,
}
file->size = size;
file->fd = os_create_anonymous_file(size);
file->fd = weston_os_create_anonymous_file(size);
if (file->fd == -1)
goto err_free;
@ -388,7 +388,7 @@ os_ro_anonymous_file_get_fd(struct ro_anonymous_file *file,
/* for all other cases we create a new anonymous file that can be mapped
* with MAP_SHARED and copy the contents to it and return that instead
*/
fd = os_create_anonymous_file(file->size);
fd = weston_os_create_anonymous_file(file->size);
if (fd == -1)
return fd;

View File

@ -43,7 +43,7 @@ int
os_epoll_create_cloexec(void);
int
os_create_anonymous_file(off_t size);
weston_os_create_anonymous_file(off_t size);
#ifndef HAVE_STRCHRNUL
char *

View File

@ -53,7 +53,7 @@ DECLARE_FIXTURE_SETUP(fixture_setup);
* behave like older clients, and allow ftruncate() to shrink the files size,
* so SIGBUS can still happen.
*
* There is no reason not to use os_create_anonymous_file() otherwise. */
* There is no reason not to use weston_os_create_anonymous_file() otherwise. */
#ifndef HAVE_MKOSTEMP
static int

View File

@ -503,7 +503,7 @@ create_shm_buffer(struct client *client, int width, int height,
buf->len = stride_bytes * height;
assert(buf->len / stride_bytes == (unsigned)height);
fd = os_create_anonymous_file(buf->len);
fd = weston_os_create_anonymous_file(buf->len);
assert(fd >= 0);
data = mmap(NULL, buf->len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);

View File

@ -88,7 +88,7 @@ yuv_buffer_create(struct client *client,
buf->width = width;
buf->height = height;
fd = os_create_anonymous_file(buf->bytes);
fd = weston_os_create_anonymous_file(buf->bytes);
assert(fd >= 0);
buf->data = mmap(NULL, buf->bytes,