Skip to content
This repository was archived by the owner on May 15, 2023. It is now read-only.

Decode HDR_OUTPUT_METADATA#53

Open
codewiz wants to merge 2 commits into
ascent12:masterfrom
codewiz:master
Open

Decode HDR_OUTPUT_METADATA#53
codewiz wants to merge 2 commits into
ascent12:masterfrom
codewiz:master

Conversation

@codewiz
Copy link
Copy Markdown

@codewiz codewiz commented Jun 12, 2020

This was essential in debugging some HDR enablement code I'm working on.

In the pretty-print output, all fields are decoded to integers.
If someone deems it useful, I could put in the extra work to show enum
names and convert the fixed-point values to floats in the 0.0-1.0 range.

In the JSON output, I deliberately flattened the primaries to separate
fields for the B, G and B components because I felt that the array
notation is less readable.

This was essential in debugging some HDR enablement code I'm working on.

In the pretty-print output, all fields are decoded to integers.
If someone deems it useful, I could put in the extra work to show enum
names and convert the fixed-point values to floats in the 0.0-1.0 range.

Im the json output, I deliberately flattened the primaries to separate
fields for the B, G and B components because I felt that the array
notation is less redable.
Comment thread json.c
Comment thread json.c Outdated
NOTE: Squash this commit before merging.
@codewiz codewiz requested a review from emersion June 15, 2020 13:42
Comment thread pretty.c
struct json_object_iter iter;
json_object_object_foreachC(arr, iter) {
if (iter.val) {
printf("%s%s\"%s\" = %"PRIu64"\n",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to manually print each field here. This would allow us to get human-readable output. Enums could be pretty-printed with the stringified enum name and its value (like we do for modifiers, but no need for code generation). Fields with X/Y values could be printed on a single line.

Comment thread json.c

struct json_object *obj = json_object_new_object();
json_object_object_add(obj, "type", new_json_object_uint64(meta->metadata_type));
if (meta->metadata_type == 1 /*HDMI_STATIC_METADATA_TYPE1*/) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we #define this?

@ascent12
Copy link
Copy Markdown
Owner

I'll just point out that I don't merge anything until any Linux and/or libdrm version it depends on is in at least Archlinux stable.

@ppaalanen
Copy link
Copy Markdown

I'll just point out that I don't merge anything until any Linux and/or libdrm version it depends on is in at least Archlinux stable.

Does this mean you want the copy of the struct to be deleted here and just use libdrm 2.4.104 instead?

Do you have libdrm 2.4.104 where you want it yet? There are no other deps.

@emersion
Copy link
Copy Markdown
Collaborator

drm_info pulls the latest libdrm with Meson subprojects automatically if it's not new enough. (drm_info always uses the system dynamic library for libdrm, but may pull recent kernel uapi headers from the subproject.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants