Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • keshto/wlroots
  • markbolhuis/wlroots
  • joanbrugueram/wlroots
  • ammen99/wlroots
  • mfk530/wlroots
  • lovesegfault/wlroots
  • Programmerino/wlroots
  • wlroots/wlroots
  • mstoeckl/wlroots
  • emersion/wlroots
  • tadeokondrak/wlroots
  • MisterDA/wlroots
  • vyivel/wlroots
  • agx/wlroots
  • bl4ckb0ne/wlroots
  • ifreund/wlroots
  • Beryesa/wlroots
  • colemickens/wlroots
  • frog/wlroots
  • raphaelr/wlroots
  • etom/wlroots
  • Emantor/wlroots
  • romangg/wlroots
  • DemiMarie/wlroots
  • lilydjwg/wlroots
  • ashafer/wlroots
  • ericonr/wlroots
  • jlindgren90/wlroots
  • hurrdurr/wlroots
  • quantum/wlroots
  • alex-courtis/wlroots
  • zagursky/wlroots
  • zavorka/wlroots
  • nowrep/wlroots
  • StacyHarper/wlroots
  • valpackett/wlroots
  • nyorain/wlroots
  • kimhoai.nguyen123/wlroots
  • Nefsen402/wlroots
  • duncanm/wlroots
  • tchebb/wlroots
  • kennylevinsen/wlroots
  • demansanaa/wlroots
  • sjnewbury/wlroots
  • illiliti/wlroots
  • martinetd/wlroots
  • keithbowes/wlroots
  • beviu/wlroots
  • andri/wlroots
  • JoseExposito/wlroots
  • held-m/wlroots
  • dos/wlroots
  • OctopusET/wlroots
  • jide/wlroots
  • David96/wlroots
  • sammko/wlroots
  • wingdeans/wlroots
  • lostmythread/wlroots
  • sevz/wlroots
  • yrlf/wlroots
  • tmlind/wlroots
  • nagy/wlroots
  • brocellous/wlroots
  • kchibisov/wlroots
  • caseorum/wlroots
  • zsugabubus/wlroots
  • ptrcnull/wlroots
  • sktt/wlroots
  • yiqiang/wlroots
  • dzmien/wlroots
  • vaxerski/wlroots
  • Consolatis/wlroots
  • paraworker/wlroots
  • maccraft/wlroots
  • johanmalm/wlroots
  • bi4k8/wlroots
  • fakeczg/wlroots
  • stshine/wlroots
  • puckipedia/wlroots
  • vanfanel/wlroots
  • laxyy/wlroots
  • gabcoh/wlroots
  • lack/wlroots
  • shua/wlroots
  • xiliuya/wlroots
  • prehonor/wlroots
  • BBaoVanC/wlroots
  • qaqland/wlroots
  • llyyr/wlroots
  • clamps/wlroots
  • Woodpile37/wlroots
  • samuel/wlroots
  • eric/wlroots
  • vvavrychuk/wlroots
  • 9ary/wlroots
  • gvideo434/wlroots
  • alxu/wlroots
  • tobias.predel/wlroots
  • rosefromthedead/wlroots
  • philipp.kaeser/wlroots
  • phnaharris/wlroots
  • Drakulix/wlroots
  • Edgars-Cirulis/wlroots
  • EBADBEEF/wlroots
  • mainiomano/wlroots
  • gilvbp/wlroots
  • Leon-Plickat/wlroots
  • ghishadow/wlroots
  • evyatark2/wlroots
  • craftyguy/wlroots
  • mherrb/wlroots
  • Dudemanguy/wlroots
  • ErikReider/wlroots
  • wineee/wlroots
  • q234rty/wlroots
  • maaarghk/wlroots
  • saihaze/wlroots
  • wingedcutter/wlroots
  • YellowOnion/wlroots
  • jdtatz/wlroots
  • aadi58002/wlroots
  • leoli/wlroots-output-layers
  • MoetaYuko/wlroots
  • SergioGDR/wlroots
  • kelnos/wlroots
  • kode54/wlroots
  • navi_desu/wlroots
  • eerii/wlroots
  • sunzhguy/wlroots
  • zorowk/wlroots
  • dkondor1/wlroots
  • lahavts/wlroots
  • bwhmather/wlroots
  • mcoffin/wlroots
  • praschke/wlroots
  • trofi/wlroots
  • MaxVerevkin/wlroots
  • 6by9/wlroots
  • svalaskevicius/wlroots
  • Rui511/wlroots
  • fpoisot/wlroots
  • danieldg/wlroots
  • grisha128/wlroots
  • serebit/wlrplus
  • david.turner/wlroots
  • pcercuei/wlroots
  • columbarius/wlroots-tmp
  • sleirsgoevy/wlroots
  • HeYong/wlroots
  • Louis_Goyard/wlroots
  • iforbes/wlroots
  • vimproved/wlroots
  • toast/wlroots
  • shadowgamer67890/wlroots-rhpd
  • tomenglund26/wlroots
  • WhyNotHugo/wlroots
  • Groveer/wlroots
  • luyn/wlroots
  • n3rdopolis/wlroots
  • amfcosta13/wlroots
  • BiRD04/wlroots
  • Billli11/wlroots
  • chenyongxing/wlroots
  • sewn/wlroots
  • kkartaltepe/wlroots
  • furball/wlroots
  • carbonXIII/wlroots
  • ali1234/wlroots
  • project-repo/wlroots
  • garlett/wlroots-lease-multiseat
  • C0rn3j/wlroots
  • arun-mani-j/wlroots
  • liup/wlroots
  • qyliss/wlroots
  • tatokis/wlroots
  • masiukiewicz.michal/wlroots
  • asterwyx/wlroots
  • tokyo4j/wlroots
  • tych0/wlroots
  • james.jehiel.ramsey/wlroots
  • zzxyb/wlroots
  • iv.dovg/wlroots
  • atbjyk/wlroots
  • agorgl/wlroots
  • carlo.wood/wlroots
  • chirsz/wlroots
  • thomy2000/wlroots
187 results
Show changes
Commits on Source (4)
  • Simon Ser's avatar
    backend/drm: de-duplicate wlr_drm_mode creation · 800ea7d5
    Simon Ser authored and Alexander Orzechowski's avatar Alexander Orzechowski committed
    Introduce a function to convert a drmModeModeInfo into a new
    wlr_drm_mode.
    800ea7d5
  • Simon Ser's avatar
    output: fix back buffer checks · 8e8b9a72
    Simon Ser authored
    The back buffer is no longer set at commit time since 0556aa0c
    ("output: rejigger attach/clear for back buffer").
    
    Instead, check whether the buffer belongs to the output swapchain.
    This is more robust.
    
    Closes: #3496
    8e8b9a72
  • John Lindgren's avatar
    cursor: Add a more general check for infinite/NaN cursor position · 5417a182
    John Lindgren authored
    It should be considered a bug if a compositor sets a non-finite
    cursor position, so fail loudly (in debug builds) if that happens.
    
    The existing check in wlr_cursor_warp_closest() is now redundant,
    and would silently hide such bugs, so remove it.
    5417a182
  • John Lindgren's avatar
    cursor: Don't warp to (0,0) when last output is disconnected · 68c8cef3
    John Lindgren authored
    There doesn't appear to be any good reason to warp the cursor to
    the top-left corner when all outputs are disconnected; it's no more
    valid than any other (x,y) point in that case.
    
    The real-world case here is a user with a single external monitor
    turning it off (which apparently counts as disconnected depending
    on the connection type/hardware).  For that user, it's desirable to
    have the cursor remain in its original location when the monitor
    is turned back on.
    68c8cef3
......@@ -750,6 +750,23 @@ static bool drm_connector_set_mode(struct wlr_drm_connector *conn,
return true;
}
static struct wlr_drm_mode *drm_mode_create(const drmModeModeInfo *modeinfo) {
struct wlr_drm_mode *mode = calloc(1, sizeof(*mode));
if (!mode) {
return NULL;
}
mode->drm_mode = *modeinfo;
mode->wlr_mode.width = mode->drm_mode.hdisplay;
mode->wlr_mode.height = mode->drm_mode.vdisplay;
mode->wlr_mode.refresh = calculate_refresh_rate(modeinfo);
if (modeinfo->type & DRM_MODE_TYPE_PREFERRED) {
mode->wlr_mode.preferred = true;
}
return mode;
}
struct wlr_output_mode *wlr_drm_connector_add_mode(struct wlr_output *output,
const drmModeModeInfo *modeinfo) {
struct wlr_drm_connector *conn = get_drm_connector_from_output(output);
......@@ -766,21 +783,17 @@ struct wlr_output_mode *wlr_drm_connector_add_mode(struct wlr_output *output,
}
}
struct wlr_drm_mode *mode = calloc(1, sizeof(*mode));
struct wlr_drm_mode *mode = drm_mode_create(modeinfo);
if (!mode) {
return NULL;
}
memcpy(&mode->drm_mode, modeinfo, sizeof(*modeinfo));
mode->wlr_mode.width = mode->drm_mode.hdisplay;
mode->wlr_mode.height = mode->drm_mode.vdisplay;
mode->wlr_mode.refresh = calculate_refresh_rate(modeinfo);
wl_list_insert(&conn->output.modes, &mode->wlr_mode.link);
wlr_drm_conn_log(conn, WLR_INFO, "Registered custom mode "
"%"PRId32"x%"PRId32"@%"PRId32,
mode->wlr_mode.width, mode->wlr_mode.height,
mode->wlr_mode.refresh);
wl_list_insert(&conn->output.modes, &mode->wlr_mode.link);
return &mode->wlr_mode;
}
......@@ -1352,7 +1365,7 @@ void scan_drm_connectors(struct wlr_drm_backend *drm,
}
} else {
// Use the modern atomic drm interface.
size_t modeinfo_size = 0;
size_t modeinfo_size = 0;
current_modeinfo = get_drm_prop_blob(drm->fd, wlr_conn->crtc->id,
wlr_conn->crtc->props.mode_id, &modeinfo_size);
assert(modeinfo_size == sizeof(drmModeModeInfo));
......@@ -1362,23 +1375,14 @@ void scan_drm_connectors(struct wlr_drm_backend *drm,
wlr_log(WLR_INFO, "Detected modes:");
for (int i = 0; i < drm_conn->count_modes; ++i) {
struct wlr_drm_mode *mode = calloc(1, sizeof(*mode));
if (!mode) {
wlr_log_errno(WLR_ERROR, "Allocation failed");
continue;
}
if (drm_conn->modes[i].flags & DRM_MODE_FLAG_INTERLACE) {
free(mode);
continue;
}
mode->drm_mode = drm_conn->modes[i];
mode->wlr_mode.width = mode->drm_mode.hdisplay;
mode->wlr_mode.height = mode->drm_mode.vdisplay;
mode->wlr_mode.refresh = calculate_refresh_rate(&mode->drm_mode);
if (mode->drm_mode.type & DRM_MODE_TYPE_PREFERRED) {
mode->wlr_mode.preferred = true;
struct wlr_drm_mode *mode = drm_mode_create(&drm_conn->modes[i]);
if (!mode) {
wlr_log_errno(WLR_ERROR, "Allocation failed");
continue;
}
// If this is the current mode set on the conn's crtc,
......
......@@ -8,6 +8,8 @@ void output_pending_resolution(struct wlr_output *output,
const struct wlr_output_state *state, int *width, int *height);
void output_state_attach_buffer(struct wlr_output_state *state,
struct wlr_buffer *buffer);
bool output_is_direct_scanout(struct wlr_output *output,
struct wlr_buffer *buffer);
struct wlr_drm_format *output_pick_format(struct wlr_output *output,
const struct wlr_drm_format_set *display_formats, uint32_t format);
......
......@@ -575,7 +575,7 @@ static bool output_basic_test(struct wlr_output *output,
return false;
}
if (output->back_buffer == NULL) {
if (output_is_direct_scanout(output, state->buffer)) {
if (output->attach_render_locks > 0) {
wlr_log(WLR_DEBUG, "Direct scan-out disabled by lock");
return false;
......
......@@ -329,3 +329,18 @@ uint32_t wlr_output_preferred_read_format(struct wlr_output *output) {
return fmt;
}
bool output_is_direct_scanout(struct wlr_output *output,
struct wlr_buffer *buffer) {
if (output->swapchain == NULL) {
return true;
}
for (size_t i = 0; i < WLR_SWAPCHAIN_CAP; i++) {
if (output->swapchain->slots[i].buffer == buffer) {
return false;
}
}
return true;
}
......@@ -211,6 +211,10 @@ static struct wlr_cursor_device *get_cursor_device(struct wlr_cursor *cur,
static void cursor_warp_unchecked(struct wlr_cursor *cur,
double lx, double ly) {
assert(cur->state->layout);
if (!isfinite(lx) || !isfinite(ly)) {
assert(false);
return;
}
struct wlr_cursor_output_cursor *output_cursor;
wl_list_for_each(output_cursor, &cur->state->output_cursors, link) {
......@@ -296,13 +300,19 @@ void wlr_cursor_warp_closest(struct wlr_cursor *cur,
get_mapping(cur, dev, &mapping);
if (!wlr_box_empty(&mapping)) {
wlr_box_closest_point(&mapping, lx, ly, &lx, &ly);
if (isnan(lx) || isnan(ly)) {
lx = 0;
ly = 0;
}
} else {
} else if (!wl_list_empty(&cur->state->layout->outputs)) {
wlr_output_layout_closest_point(cur->state->layout, NULL, lx, ly,
&lx, &ly);
} else {
/*
* There is no mapping box for the input device and the
* output layout is empty. This can happen for example
* when external monitors are turned off/disconnected.
* In this case, all (x,y) points are equally invalid,
* so leave the cursor in its current location (better
* from a user standpoint than warping it to (0,0)).
*/
return;
}
cursor_warp_unchecked(cur, lx, ly);
......@@ -819,9 +829,9 @@ static void handle_layout_change(struct wl_listener *listener, void *data) {
struct wlr_output_layout *layout = data;
if (!wlr_output_layout_contains_point(layout, NULL, state->cursor->x,
state->cursor->y)) {
state->cursor->y) && !wl_list_empty(&layout->outputs)) {
// the output we were on has gone away so go to the closest boundary
// point
// point (unless the layout is empty; compare warp_closest())
double x, y;
wlr_output_layout_closest_point(layout, NULL, state->cursor->x,
state->cursor->y, &x, &y);
......
......@@ -5,6 +5,7 @@
#include <wlr/types/wlr_output_damage.h>
#include <wlr/types/wlr_output.h>
#include <wlr/util/box.h>
#include "types/wlr_output.h"
static void output_handle_destroy(struct wl_listener *listener, void *data) {
struct wlr_output_damage *output_damage =
......@@ -53,7 +54,8 @@ static void output_handle_precommit(struct wl_listener *listener, void *data) {
if (state->committed & WLR_OUTPUT_STATE_BUFFER) {
// TODO: find a better way to access this info without a precommit
// handler
output_damage->pending_attach_render = output->back_buffer != NULL;
output_damage->pending_attach_render =
output_is_direct_scanout(output, state->buffer);
}
}
......