mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-02 05:12:02 +00:00
[client] hdr: refactor name to clean up log output
This commit is contained in:
@@ -83,7 +83,7 @@ static void applyHDRPending(void)
|
|||||||
|
|
||||||
if (action == WAYLAND_HDR_PENDING_APPLY)
|
if (action == WAYLAND_HDR_PENDING_APPLY)
|
||||||
{
|
{
|
||||||
waylandSetHDRImageDescription(
|
waylandSetHDRImageDesc(
|
||||||
params.displayPrimary, params.whitePoint,
|
params.displayPrimary, params.whitePoint,
|
||||||
params.maxDisplayLuminance,
|
params.maxDisplayLuminance,
|
||||||
params.minDisplayLuminance,
|
params.minDisplayLuminance,
|
||||||
@@ -94,10 +94,10 @@ static void applyHDRPending(void)
|
|||||||
params.metadata);
|
params.metadata);
|
||||||
}
|
}
|
||||||
else if (action == WAYLAND_HDR_PENDING_CLEAR)
|
else if (action == WAYLAND_HDR_PENDING_CLEAR)
|
||||||
waylandClearHDRImageDescription();
|
waylandClearHDRImageDesc();
|
||||||
}
|
}
|
||||||
|
|
||||||
void waylandClearHDRImageDescription(void)
|
void waylandClearHDRImageDesc(void)
|
||||||
{
|
{
|
||||||
LG_LOCK(wlWm.hdrLock);
|
LG_LOCK(wlWm.hdrLock);
|
||||||
if (wlWm.hdrImageCreator)
|
if (wlWm.hdrImageCreator)
|
||||||
@@ -120,7 +120,7 @@ void waylandClearHDRImageDescription(void)
|
|||||||
DEBUG_INFO("HDR image description removed from surface");
|
DEBUG_INFO("HDR image description removed from surface");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hdrImageDescriptionReady(struct wp_image_description_v1 * desc)
|
static void hdrImageDescReady(struct wp_image_description_v1 * desc)
|
||||||
{
|
{
|
||||||
LG_LOCK(wlWm.hdrLock);
|
LG_LOCK(wlWm.hdrLock);
|
||||||
if (desc != wlWm.hdrImageDesc)
|
if (desc != wlWm.hdrImageDesc)
|
||||||
@@ -150,7 +150,7 @@ static void hdrImageDescriptionReady(struct wp_image_description_v1 * desc)
|
|||||||
waylandStopWaitFrame();
|
waylandStopWaitFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void activateReadyHDRImageDescription(void)
|
static void activateReadyHDRImageDesc(void)
|
||||||
{
|
{
|
||||||
LG_LOCK(wlWm.hdrLock);
|
LG_LOCK(wlWm.hdrLock);
|
||||||
if (!wlWm.hdrImageDesc || !wlWm.hdrImageDescReady || !wlWm.colorSurface)
|
if (!wlWm.hdrImageDesc || !wlWm.hdrImageDescReady || !wlWm.colorSurface)
|
||||||
@@ -180,7 +180,7 @@ static void activateReadyHDRImageDescription(void)
|
|||||||
waylandStopWaitFrame();
|
waylandStopWaitFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hdrImageDescriptionFailed(void * data,
|
static void hdrImageDescFailed(void * data,
|
||||||
struct wp_image_description_v1 * desc, uint32_t cause, const char * message)
|
struct wp_image_description_v1 * desc, uint32_t cause, const char * message)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
@@ -203,29 +203,29 @@ static void hdrImageDescriptionFailed(void * data,
|
|||||||
waylandStopWaitFrame();
|
waylandStopWaitFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hdrImageDescriptionReadyV1(void * data,
|
static void hdrImageDescReadyV1(void * data,
|
||||||
struct wp_image_description_v1 * desc, uint32_t identity)
|
struct wp_image_description_v1 * desc, uint32_t identity)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)identity;
|
(void)identity;
|
||||||
hdrImageDescriptionReady(desc);
|
hdrImageDescReady(desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hdrImageDescriptionReadyV2(void * data,
|
static void hdrImageDescReadyV2(void * data,
|
||||||
struct wp_image_description_v1 * desc, uint32_t identityHi,
|
struct wp_image_description_v1 * desc, uint32_t identityHi,
|
||||||
uint32_t identityLo)
|
uint32_t identityLo)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)identityHi;
|
(void)identityHi;
|
||||||
(void)identityLo;
|
(void)identityLo;
|
||||||
hdrImageDescriptionReady(desc);
|
hdrImageDescReady(desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct wp_image_description_v1_listener hdrImageDescListener =
|
static const struct wp_image_description_v1_listener hdrImageDescListener =
|
||||||
{
|
{
|
||||||
.failed = hdrImageDescriptionFailed,
|
.failed = hdrImageDescFailed,
|
||||||
.ready = hdrImageDescriptionReadyV1,
|
.ready = hdrImageDescReadyV1,
|
||||||
.ready2 = hdrImageDescriptionReadyV2,
|
.ready2 = hdrImageDescReadyV2,
|
||||||
};
|
};
|
||||||
|
|
||||||
void waylandEGLSwapBuffers(EGLDisplay display, EGLSurface surface, const struct Rect * damage, int count)
|
void waylandEGLSwapBuffers(EGLDisplay display, EGLSurface surface, const struct Rect * damage, int count)
|
||||||
@@ -244,7 +244,7 @@ void waylandEGLSwapBuffers(EGLDisplay display, EGLSurface surface, const struct
|
|||||||
waylandPresentationFrame();
|
waylandPresentationFrame();
|
||||||
applyHDRPending();
|
applyHDRPending();
|
||||||
swapWithDamage(&wlWm.swapWithDamage, display, surface, damage, count);
|
swapWithDamage(&wlWm.swapWithDamage, display, surface, damage, count);
|
||||||
activateReadyHDRImageDescription();
|
activateReadyHDRImageDesc();
|
||||||
|
|
||||||
if (wlWm.needsResize)
|
if (wlWm.needsResize)
|
||||||
{
|
{
|
||||||
@@ -363,7 +363,7 @@ static bool hdrTargetLuminanceContained(uint32_t minLuminance,
|
|||||||
maxLuminance <= HDR_PQ_MAX_LUMINANCE;
|
maxLuminance <= HDR_PQ_MAX_LUMINANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void waylandSetHDRImageDescription(const uint16_t displayPrimary[3][2],
|
void waylandSetHDRImageDesc(const uint16_t displayPrimary[3][2],
|
||||||
const uint16_t whitePoint[2], uint32_t maxDisplayLuminance,
|
const uint16_t whitePoint[2], uint32_t maxDisplayLuminance,
|
||||||
uint32_t minDisplayLuminance, uint32_t maxCLL, uint32_t maxFALL,
|
uint32_t minDisplayLuminance, uint32_t maxCLL, uint32_t maxFALL,
|
||||||
uint32_t referenceWhiteLevel, bool hdrPQ, bool hdrMetadata)
|
uint32_t referenceWhiteLevel, bool hdrPQ, bool hdrMetadata)
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ static void outputRequestColorDescription(struct WaylandOutput * output)
|
|||||||
desc->description, &outputDescriptionListener, desc);
|
desc->description, &outputDescriptionListener, desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void outputImageDescriptionChanged(void * data,
|
static void outputImageDescChanged(void * data,
|
||||||
struct wp_color_management_output_v1 * colorOutput)
|
struct wp_color_management_output_v1 * colorOutput)
|
||||||
{
|
{
|
||||||
outputRequestColorDescription(data);
|
outputRequestColorDescription(data);
|
||||||
@@ -248,7 +248,7 @@ static void outputImageDescriptionChanged(void * data,
|
|||||||
|
|
||||||
static const struct wp_color_management_output_v1_listener colorOutputListener =
|
static const struct wp_color_management_output_v1_listener colorOutputListener =
|
||||||
{
|
{
|
||||||
.image_description_changed = outputImageDescriptionChanged,
|
.image_description_changed = outputImageDescChanged,
|
||||||
};
|
};
|
||||||
|
|
||||||
void waylandOutputColorMgmtInit(struct WaylandOutput * output)
|
void waylandOutputColorMgmtInit(struct WaylandOutput * output)
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ struct LG_DisplayServerOps LGDS_Wayland =
|
|||||||
.getFullscreen = waylandGetFullscreen,
|
.getFullscreen = waylandGetFullscreen,
|
||||||
.minimize = waylandMinimize,
|
.minimize = waylandMinimize,
|
||||||
|
|
||||||
.setHDRImageDescription = waylandHDRCallback,
|
.setHDRImageDesc = waylandHDRCallback,
|
||||||
|
|
||||||
.cbInit = waylandCBInit,
|
.cbInit = waylandCBInit,
|
||||||
.cbNotice = waylandCBNotice,
|
.cbNotice = waylandCBNotice,
|
||||||
|
|||||||
@@ -345,11 +345,11 @@ void waylandGLSwapBuffers(void);
|
|||||||
// HDR color management (Wayland color-management-v1)
|
// HDR color management (Wayland color-management-v1)
|
||||||
bool waylandColorMgmtInit(void);
|
bool waylandColorMgmtInit(void);
|
||||||
void waylandColorMgmtFree(void);
|
void waylandColorMgmtFree(void);
|
||||||
void waylandSetHDRImageDescription(const uint16_t displayPrimary[3][2],
|
void waylandSetHDRImageDesc(const uint16_t displayPrimary[3][2],
|
||||||
const uint16_t whitePoint[2], uint32_t maxDisplayLuminance,
|
const uint16_t whitePoint[2], uint32_t maxDisplayLuminance,
|
||||||
uint32_t minDisplayLuminance, uint32_t maxCLL, uint32_t maxFALL,
|
uint32_t minDisplayLuminance, uint32_t maxCLL, uint32_t maxFALL,
|
||||||
uint32_t referenceWhiteLevel, bool hdrPQ, bool hdrMetadata);
|
uint32_t referenceWhiteLevel, bool hdrPQ, bool hdrMetadata);
|
||||||
void waylandClearHDRImageDescription(void);
|
void waylandClearHDRImageDesc(void);
|
||||||
|
|
||||||
// Queue HDR change from any thread (applied in waylandEGLSwapBuffers).
|
// Queue HDR change from any thread (applied in waylandEGLSwapBuffers).
|
||||||
// Returns true if the request was queued, false if HDR is not available
|
// Returns true if the request was queued, false if HDR is not available
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ bool app_getFullscreen(void);
|
|||||||
bool app_getProp(LG_DSProperty prop, void * ret);
|
bool app_getProp(LG_DSProperty prop, void * ret);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the last call to setHDRImageDescription() failed.
|
* Returns true if the last call to setHDRImageDesc() failed.
|
||||||
* When this returns true, the renderer should fall back to software
|
* When this returns true, the renderer should fall back to software
|
||||||
* tone-mapping even on a compositor that reports LG_DS_NATIVE_HDR.
|
* tone-mapping even on a compositor that reports LG_DS_NATIVE_HDR.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ typedef enum LG_DSProperty
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* returns true if the display server supports native HDR via
|
* returns true if the display server supports native HDR via
|
||||||
* setHDRImageDescription (i.e., the compositor actually has the
|
* setHDRImageDesc (i.e., the compositor actually has the
|
||||||
* required color-management features to process HDR content).
|
* required color-management features to process HDR content).
|
||||||
* return data type: bool
|
* return data type: bool
|
||||||
*/
|
*/
|
||||||
@@ -241,7 +241,7 @@ struct LG_DisplayServerOps
|
|||||||
* Returns true on success, false if the description could not be applied
|
* Returns true on success, false if the description could not be applied
|
||||||
* (e.g., compositor doesn't support the required transfer function or
|
* (e.g., compositor doesn't support the required transfer function or
|
||||||
* primaries, or the image description creation failed). */
|
* primaries, or the image description creation failed). */
|
||||||
bool (*setHDRImageDescription)(const void * rendererFormat);
|
bool (*setHDRImageDesc)(const void * rendererFormat);
|
||||||
|
|
||||||
/* clipboard support, optional, if not supported set to NULL */
|
/* clipboard support, optional, if not supported set to NULL */
|
||||||
bool (*cbInit)(void);
|
bool (*cbInit)(void);
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ struct AppState
|
|||||||
|
|
||||||
int spiceHotX, spiceHotY;
|
int spiceHotX, spiceHotY;
|
||||||
|
|
||||||
// Set to true when setHDRImageDescription() returns false, indicating
|
// Set to true when setHDRImageDesc() returns false, indicating
|
||||||
// the display server could not apply the HDR image description.
|
// the display server could not apply the HDR image description.
|
||||||
// Checked by the renderer to fall back to software tone-mapping.
|
// Checked by the renderer to fall back to software tone-mapping.
|
||||||
_Atomic(bool) hdrDescFailed;
|
_Atomic(bool) hdrDescFailed;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ static LG_RendererFormat l_surfaceFormat;
|
|||||||
|
|
||||||
static void updateSurfaceFormat(void)
|
static void updateSurfaceFormat(void)
|
||||||
{
|
{
|
||||||
if (!g_state.ds->setHDRImageDescription)
|
if (!g_state.ds->setHDRImageDesc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LG_RendererFormat format = {};
|
LG_RendererFormat format = {};
|
||||||
@@ -50,7 +50,7 @@ static void updateSurfaceFormat(void)
|
|||||||
format.hdr = false;
|
format.hdr = false;
|
||||||
format.hdrPQ = false;
|
format.hdrPQ = false;
|
||||||
format.hdrMetadata = false;
|
format.hdrMetadata = false;
|
||||||
g_state.ds->setHDRImageDescription(&format);
|
g_state.ds->setHDRImageDesc(&format);
|
||||||
atomic_store(&g_state.hdrDescFailed, false);
|
atomic_store(&g_state.hdrDescFailed, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -63,12 +63,12 @@ static void updateSurfaceFormat(void)
|
|||||||
format.hdr = false;
|
format.hdr = false;
|
||||||
format.hdrPQ = false;
|
format.hdrPQ = false;
|
||||||
format.hdrMetadata = false;
|
format.hdrMetadata = false;
|
||||||
g_state.ds->setHDRImageDescription(&format);
|
g_state.ds->setHDRImageDesc(&format);
|
||||||
DEBUG_WARN("Renderer surface cannot represent the native HDR encoding; "
|
DEBUG_WARN("Renderer surface cannot represent the native HDR encoding; "
|
||||||
"using software HDR mapping");
|
"using software HDR mapping");
|
||||||
atomic_store(&g_state.hdrDescFailed, true);
|
atomic_store(&g_state.hdrDescFailed, true);
|
||||||
}
|
}
|
||||||
else if (!g_state.ds->setHDRImageDescription(&format))
|
else if (!g_state.ds->setHDRImageDesc(&format))
|
||||||
{
|
{
|
||||||
DEBUG_WARN("Display server failed to apply HDR image description");
|
DEBUG_WARN("Display server failed to apply HDR image description");
|
||||||
atomic_store(&g_state.hdrDescFailed, true);
|
atomic_store(&g_state.hdrDescFailed, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user