-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wayland: add support for frog-color-management-v1 #14917
Closed
+127
−0
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -100,6 +100,8 @@ struct priv { | |||||||
bool destroy_buffers; | ||||||||
bool force_window; | ||||||||
enum hwdec_type hwdec_type; | ||||||||
|
||||||||
struct mp_image_params target_params; | ||||||||
uint32_t drm_format; | ||||||||
uint64_t drm_modifier; | ||||||||
}; | ||||||||
|
@@ -538,6 +540,12 @@ static void resize(struct vo *vo) | |||||||
lround(vo->dheight / wl->scaling_factor)); | ||||||||
wl_subsurface_set_position(wl->osd_subsurface, lround((0 - dst.x0) / wl->scaling_factor), lround((0 - dst.y0) / wl->scaling_factor)); | ||||||||
set_viewport_source(vo, src); | ||||||||
|
||||||||
mp_mutex_lock(&vo->params_mutex); | ||||||||
vo->target_params->w = mp_rect_w(dst); | ||||||||
vo->target_params->h = mp_rect_h(dst); | ||||||||
vo->target_params->rotate = (vo->params->rotate % 90) * 90; | ||||||||
mp_mutex_unlock(&vo->params_mutex); | ||||||||
} | ||||||||
|
||||||||
static bool draw_osd(struct vo *vo, struct mp_image *cur, double pts) | ||||||||
|
@@ -609,6 +617,7 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame) | |||||||
|
||||||||
pts = frame->current ? frame->current->pts : 0; | ||||||||
if (frame->current) { | ||||||||
vo_wayland_handle_hdr_metadata(wl); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dmabuf-wayland dont have
Suggested change
|
||||||||
buf = buffer_get(vo, frame); | ||||||||
|
||||||||
if (buf && buf->frame) { | ||||||||
|
@@ -691,6 +700,17 @@ static int reconfig(struct vo *vo, struct mp_image *img) | |||||||
if (!vo_wayland_reconfig(vo)) | ||||||||
return VO_ERROR; | ||||||||
|
||||||||
mp_mutex_lock(&vo->params_mutex); | ||||||||
p->target_params = img->params; | ||||||||
// Restore fallback layer parameters if available. | ||||||||
mp_image_params_restore_dovi_mapping(&p->target_params); | ||||||||
// Strip metadata that are not understood anyway. | ||||||||
struct pl_hdr_metadata *hdr = &p->target_params.color.hdr; | ||||||||
hdr->scene_max[0] = hdr->scene_max[1] = hdr->scene_max[2] = 0; | ||||||||
hdr->scene_avg = hdr->max_pq_y = hdr->avg_pq_y = 0; | ||||||||
vo->target_params = &p->target_params; | ||||||||
mp_mutex_unlock(&vo->params_mutex); | ||||||||
|
||||||||
wl_surface_set_buffer_transform(vo->wl->video_surface, img->params.rotate / 90); | ||||||||
|
||||||||
// Immediately destroy all buffers if params change. | ||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we add meson wrap for those? I think this is recommended way of importing protocols. We could do the same as https://gitlab.freedesktop.org/mesa/mesa/-/blob/e328df0c575a5c193001d06c5659a70d7c071f62/subprojects/frog-protocols.wrap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well distros are already packaging it. I don't know if we have a stance on including wraps yet. Last time we tried a wrap didn't go so well but maybe we just did it wrong.