chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert commit f131770b "tree-wide: spelling fixes"
[elogind.git]
/
src
/
libsystemd-terminal
/
grdev.c
diff --git
a/src/libsystemd-terminal/grdev.c
b/src/libsystemd-terminal/grdev.c
index aaac06ec3435eddd9c609cdfc6ad1b5a7723ae11..3b3cf2737bbf59a6538c218cd2627722912037be 100644
(file)
--- a/
src/libsystemd-terminal/grdev.c
+++ b/
src/libsystemd-terminal/grdev.c
@@
-343,7
+343,7
@@
void grdev_display_disable(grdev_display *display) {
}
}
}
}
-const grdev_display_target *grdev_display_next_target(grdev_display *display, const grdev_display_target *prev
, uint64_t minage
) {
+const grdev_display_target *grdev_display_next_target(grdev_display *display, const grdev_display_target *prev) {
grdev_display_cache *cache;
size_t idx;
grdev_display_cache *cache;
size_t idx;
@@
-374,52
+374,38
@@
const grdev_display_target *grdev_display_next_target(grdev_display *display, co
if (!pipe->running || !pipe->enabled)
continue;
if (!pipe->running || !pipe->enabled)
continue;
- /* if front-buffer is up-to-date, there's nothing to do */
- if (minage > 0 && pipe->front && pipe->front->age >= minage)
- continue;
-
/* find suitable back-buffer */
/* find suitable back-buffer */
- if (!(fb = pipe->back)) {
- if (!pipe->vtable->target || !(fb = pipe->vtable->target(pipe)))
+ if (!pipe->back) {
+ if (!pipe->vtable->target)
+ continue;
+ if (!(fb = pipe->vtable->target(pipe)))
continue;
continue;
- }
- /* if back-buffer is up-to-date, schedule flip */
- if (minage > 0 && fb->age >= minage) {
- grdev_display_flip_target(display, target, fb->age);
- continue;
+ assert(fb == pipe->back);
}
}
- /* we have an out-of-date back-buffer; return for redraw */
- target->fb = fb;
+ target->front = pipe->front;
+ target->back = pipe->back;
+
return target;
}
return NULL;
}
return target;
}
return NULL;
}
-void grdev_display_flip_target(grdev_display *display, const grdev_display_target *target
, uint64_t age
) {
+void grdev_display_flip_target(grdev_display *display, const grdev_display_target *target) {
grdev_display_cache *cache;
grdev_display_cache *cache;
- size_t i;
assert(display);
assert(!display->modified);
assert(display->enabled);
assert(target);
assert(display);
assert(!display->modified);
assert(display->enabled);
assert(target);
- assert(target->fb);
cache = container_of(target, grdev_display_cache, target);
assert(cache->pipe);
assert(cache->pipe->tile->display == display);
cache = container_of(target, grdev_display_cache, target);
assert(cache->pipe);
assert(cache->pipe->tile->display == display);
- /* reset age of all FB on overflow */
- if (age < target->fb->age)
- for (i = 0; i < cache->pipe->max_fbs; ++i)
- if (cache->pipe->fbs[i])
- cache->pipe->fbs[i]->age = 0;
-
- ((grdev_fb*)target->fb)->age = age;
cache->pipe->flip = true;
}
cache->pipe->flip = true;
}
@@
-591,8
+577,8
@@
static bool display_cache(grdev_display *display) {
out:
if (r < 0)
out:
if (r < 0)
- log_debug
("grdev: %s/%s: cannot cache pipes: %s
",
-
display->session->name, display->name, strerror(-r)
);
+ log_debug
_errno(r, "grdev: %s/%s: cannot cache pipes: %m
",
+
display->session->name, display->name
);
return true;
}
return true;
}
@@
-722,7
+708,7
@@
void grdev_pipe_ready(grdev_pipe *pipe, bool running) {
/* grdev_pipe_ready() is used by backends to notify about pipe state
* changed. If a pipe is ready, it can be fully used by us (available,
/* grdev_pipe_ready() is used by backends to notify about pipe state
* changed. If a pipe is ready, it can be fully used by us (available,
- * enabled and access
a
ble). Backends can disable pipes at any time
+ * enabled and access
i
ble). Backends can disable pipes at any time
* (like for async revocation), but can only enable them from parent
* context. Otherwise, we might call user-callbacks recursively. */
* (like for async revocation), but can only enable them from parent
* context. Otherwise, we might call user-callbacks recursively. */
@@
-786,8
+772,8
@@
void grdev_pipe_schedule(grdev_pipe *pipe, uint64_t frames) {
return;
error:
return;
error:
- log_debug
("grdev: %s/%s/%s: cannot schedule vsync timer: %s
",
-
pipe->card->session->name, pipe->card->name, pipe->name, strerror(-r)
);
+ log_debug
_errno(r, "grdev: %s/%s/%s: cannot schedule vsync timer: %m
",
+
pipe->card->session->name, pipe->card->name, pipe->name
);
}
/*
}
/*
@@
-1190,8
+1176,8
@@
void grdev_session_add_drm(grdev_session *session, struct udev_device *ud) {
r = grdev_drm_card_new(&card, session, ud);
if (r < 0) {
r = grdev_drm_card_new(&card, session, ud);
if (r < 0) {
- log_debug
("grdev: %s: cannot add DRM device for %s: %s
",
-
session->name, udev_device_get_syspath(ud), strerror(-r
));
+ log_debug
_errno(r, "grdev: %s: cannot add DRM device for %s: %m
",
+
session->name, udev_device_get_syspath(ud
));
return;
}
return;
}
@@
-1283,8
+1269,8
@@
static void session_configure(grdev_session *session) {
} else if (!display) {
r = grdev_display_new(&display, session, pipe->name);
if (r < 0) {
} else if (!display) {
r = grdev_display_new(&display, session, pipe->name);
if (r < 0) {
- log_debug
("grdev: %s/%s: cannot create display for pipe %s: %s
",
-
session->name, card->name, pipe->name, strerror(-r)
);
+ log_debug
_errno(r, "grdev: %s/%s: cannot create display for pipe %s: %m
",
+
session->name, card->name, pipe->name
);
continue;
}
}
continue;
}
}