mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-09 00:31:31 +00:00
[client] wayland: use nominal refresh for frame demand
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
Use the current wl_output mode for the requested producer cadence. Presentation feedback can follow a slower VRR cadence, feeding that low update rate back into the IDD. Select the fastest nominal mode when a window spans multiple outputs.
This commit is contained in:
@@ -316,8 +316,9 @@ static void outputModeHandler(void * opaque, struct wl_output * wl_output, uint3
|
||||
return;
|
||||
|
||||
struct WaylandOutput * node = opaque;
|
||||
node->modeWidth = width;
|
||||
node->modeHeight = height;
|
||||
node->modeWidth = width;
|
||||
node->modeHeight = height;
|
||||
node->modeRefresh = refresh;
|
||||
}
|
||||
|
||||
static void outputDoneHandler(void * opaque, struct wl_output * output)
|
||||
@@ -483,3 +484,27 @@ struct WaylandScale waylandOutputGetScale(struct wl_output * output)
|
||||
return node->scale;
|
||||
return waylandScaleFromInt(0);
|
||||
}
|
||||
|
||||
bool waylandOutputGetFramePeriod(uint64_t * period)
|
||||
{
|
||||
uint64_t fastest = 0;
|
||||
struct SurfaceOutput * surfaceOutput;
|
||||
wl_list_for_each(surfaceOutput, &wlWm.surfaceOutputs, link)
|
||||
{
|
||||
const struct WaylandOutput * output =
|
||||
outputFind(surfaceOutput->output);
|
||||
if (!output || output->modeRefresh <= 0)
|
||||
continue;
|
||||
|
||||
const uint64_t candidate =
|
||||
1000000000000ULL / (uint64_t)output->modeRefresh;
|
||||
if (!fastest || candidate < fastest)
|
||||
fastest = candidate;
|
||||
}
|
||||
|
||||
if (!fastest)
|
||||
return false;
|
||||
|
||||
*period = fastest;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -73,6 +73,12 @@ static void presentationFeedbackPresented(void * opaque,
|
||||
|
||||
bool waylandGetFramePeriod(uint64_t * period)
|
||||
{
|
||||
/* Frame demand must use the output's nominal rate. Basing demand on the
|
||||
* observed presentation interval can lock a VRR session at its current,
|
||||
* slower cadence. */
|
||||
if (waylandOutputGetFramePeriod(period))
|
||||
return true;
|
||||
|
||||
const uint64_t value = atomic_load(&wlWm.presentationPeriod);
|
||||
if (!value)
|
||||
return false;
|
||||
|
||||
@@ -78,6 +78,7 @@ struct WaylandOutput
|
||||
int32_t logicalHeight;
|
||||
int32_t modeWidth;
|
||||
int32_t modeHeight;
|
||||
int32_t modeRefresh;
|
||||
bool modeRotate;
|
||||
struct wl_output * output;
|
||||
struct zxdg_output_v1 * xdgOutput;
|
||||
@@ -386,6 +387,7 @@ void waylandOutputFree(void);
|
||||
void waylandOutputBind(uint32_t name, uint32_t version);
|
||||
void waylandOutputTryUnbind(uint32_t name);
|
||||
struct WaylandScale waylandOutputGetScale(struct wl_output * output);
|
||||
bool waylandOutputGetFramePeriod(uint64_t * period);
|
||||
void waylandOutputColorMgmtInit(struct WaylandOutput * output);
|
||||
void waylandOutputColorMgmtInitAll(void);
|
||||
void waylandOutputUpdateHDRWhiteLevel(void);
|
||||
|
||||
Reference in New Issue
Block a user