Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package drm_info for openSUSE:Factory checked in at 2026-11-30 14:27:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/drm_info (Old) and /work/SRC/openSUSE:Factory/.drm_info.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "drm_info" Mon Nov 30 14:27:45 2026 rev:8 rq:1401532 version:2.11.0 Changes: -------- --- /work/SRC/openSUSE:Factory/drm_info/drm_info.changes 2026-06-05 14:58:22.791541402 +0200 +++ /work/SRC/openSUSE:Factory/.drm_info.new.1340718/drm_info.changes 2026-11-30 14:30:56.239403501 +0100 @@ -1,0 +2,13 @@ +Mon Nov 30 06:11:48 UTC 2026 - Jiri Slaby <[email protected]> + +- Update to 2.11.0 + - Add pager integration + - Add support for the BACKGROUND_COLOR CRTC property + - Improve property pretty-printing: + * Use floating-point numbers with raw hex values for SRC_* properties + * Print RANGE raw values in hex when the data field is populated + * Fix data type assumptions when pretty-printing RANGE and SIGNED_RANGE + properties + * Add newline separator in ENUM property pretty-printing + +------------------------------------------------------------------- Old: ---- drm_info-2.10.0.tar.gz New: ---- drm_info-2.11.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ drm_info.spec ++++++ --- /var/tmp/diff_new_pack.btsz8M/_old 2026-11-30 14:30:57.601460718 +0100 +++ /var/tmp/diff_new_pack.btsz8M/_new 2026-11-30 14:30:57.602460760 +0100 @@ -17,7 +17,7 @@ Name: drm_info -Version: 2.10.0 +Version: 2.11.0 Release: 0 Summary: Small utility to dump info about DRM devices License: MIT @@ -29,7 +29,7 @@ BuildRequires: pkg-config BuildRequires: pkgconfig(json-c) >= 0.14 BuildRequires: pkgconfig(libdisplay-info) -BuildRequires: pkgconfig(libdrm) >= 2.4.104 +BuildRequires: pkgconfig(libdrm) >= 2.4.134 BuildRequires: pkgconfig(libpci) BuildRequires: python3-base BuildRequires: scdoc ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.btsz8M/_old 2026-11-30 14:30:57.635462146 +0100 +++ /var/tmp/diff_new_pack.btsz8M/_new 2026-11-30 14:30:57.638462272 +0100 @@ -1,4 +1,4 @@ -mtime: 1780554246 -commit: 4a275daaf21315d208a42dc0782e1cbe6d195c762d85b7f3368132c53f0a3c51 +mtime: 1796019269 +commit: c82d1d67c412a77f346ba727a4549d2a4ab4c5e647293665866320ed56f20f90 url: https://src.opensuse.org/jirislaby/hw-drm_info ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-11-30 07:14:29.000000000 +0100 @@ -0,0 +1,4 @@ +*.obscpio +*.osc +_build.* +.pbuild ++++++ drm_info-2.10.0.tar.gz -> drm_info-2.11.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/drm_info-v2.10.0/drm_info.1.scd new/drm_info-v2.11.0/drm_info.1.scd --- old/drm_info-v2.10.0/drm_info.1.scd 2026-06-03 14:36:30.000000000 +0200 +++ new/drm_info-v2.11.0/drm_info.1.scd 2026-11-29 15:07:04.000000000 +0100 @@ -21,6 +21,12 @@ Print information in JSON format. By default, the output will be pretty-printed in a human-readable format. +# ENVIRONMENT VARIABLES + +*PAGER* + Set the pager program used when pretty-printing to a TTY. By default, + *less*(1) is used. If set to an empty string, the pager is disabled. + # AUTHORS Created by Scott Anderson <[email protected]>, maintained by diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/drm_info-v2.10.0/json.c new/drm_info-v2.11.0/json.c --- old/drm_info-v2.10.0/json.c 2026-06-03 14:36:30.000000000 +0200 +++ new/drm_info-v2.11.0/json.c 2026-11-29 15:07:04.000000000 +0100 @@ -607,6 +607,22 @@ return colorpipe_arr; } +static struct json_object *background_color_info(uint64_t value) +{ + const uint16_t *channels = (void *)&value; + uint16_t b = channels[0]; + uint16_t g = channels[1]; + uint16_t r = channels[2]; + uint16_t a = channels[3]; + + struct json_object *obj = json_object_new_object(); + json_object_object_add(obj, "r", json_object_new_double((double)r / 0xFFFF)); + json_object_object_add(obj, "g", json_object_new_double((double)g / 0xFFFF)); + json_object_object_add(obj, "b", json_object_new_double((double)b / 0xFFFF)); + json_object_object_add(obj, "a", json_object_new_double((double)a / 0xFFFF)); + return obj; +} + static struct json_object *properties_info(int fd, uint32_t id, uint32_t type) { drmModeObjectProperties *props = drmModeObjectGetProperties(fd, id, type); @@ -723,7 +739,9 @@ // This is a special case, as the SRC_* properties are // in 16.16 fixed point if (strncmp(prop->name, "SRC_", 4) == 0) { - data_obj = json_object_new_uint64(value >> 16); + data_obj = json_object_new_double((double)value / (1 << 16)); + } else if (strcmp(prop->name, "BACKGROUND_COLOR") == 0) { + data_obj = background_color_info(value); } break; case DRM_MODE_PROP_ENUM: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/drm_info-v2.10.0/main.c new/drm_info-v2.11.0/main.c --- old/drm_info-v2.10.0/main.c 2026-06-03 14:36:30.000000000 +0200 +++ new/drm_info-v2.11.0/main.c 2026-11-29 15:07:04.000000000 +0100 @@ -8,6 +8,7 @@ #include <json_util.h> #include "drm_info.h" +#include "pager.h" int main(int argc, char *argv[]) { @@ -42,8 +43,18 @@ json_object_to_fd(STDOUT_FILENO, obj, JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED); } else { + struct pager pager; + if (!pager_start(&pager)) { + exit(EXIT_FAILURE); + } + print_drm(obj); + + if (!pager_close(&pager)) { + exit(EXIT_FAILURE); + } } + json_object_put(obj); return EXIT_SUCCESS; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/drm_info-v2.10.0/meson.build new/drm_info-v2.11.0/meson.build --- old/drm_info-v2.10.0/meson.build 2026-06-03 14:36:30.000000000 +0200 +++ new/drm_info-v2.11.0/meson.build 2026-11-29 15:07:04.000000000 +0100 @@ -1,7 +1,7 @@ project( 'drm_info', 'c', - version: '2.10.0', + version: '2.11.0', license: 'MIT', meson_version: '>=0.56.0', default_options: [ @@ -91,7 +91,7 @@ executable( 'drm_info', - ['main.c', 'modifiers.c', 'json.c', 'pretty.c', 'base64.c', tables_c], + ['main.c', 'modifiers.c', 'json.c', 'pretty.c', 'base64.c', 'pager.c', tables_c], dependencies: [libdrm, libpci, libdisplay_info, jsonc], install: true, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/drm_info-v2.10.0/pager.c new/drm_info-v2.11.0/pager.c --- old/drm_info-v2.10.0/pager.c 1970-01-01 01:00:00.000000000 +0100 +++ new/drm_info-v2.11.0/pager.c 2026-11-29 15:07:04.000000000 +0100 @@ -0,0 +1,118 @@ +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <sys/wait.h> +#include <unistd.h> + +#include "pager.h" + +static void pager_exec(const char *pager_cmd, int fd) +{ + // Make it so our stdin comes from the main process + if (dup2(fd, STDIN_FILENO) < 0) { + perror("dup2() failed"); + _exit(1); + } + + // -F quits if the entire output can be displayed on a single screen + // -R allows our special tree view characters to be displayed as-is + if (setenv("LESS", "FR", 1) != 0) { + perror("setenv() failed"); + _exit(1); + } + + execlp("sh", "sh", "-c", pager_cmd, NULL); + perror("Failed to execute pager"); + + // Copy stdin to stdout as a fallback + char buf[4096]; + while (true) { + size_t n = fread(buf, 1, sizeof(buf), stdin); + if (n == 0) { + break; + } + fwrite(buf, 1, n, stdout); + } + fflush(stdout); + + _exit(1); +} + +bool pager_start(struct pager *pager) +{ + *pager = (struct pager){0}; + + if (!isatty(STDOUT_FILENO)) { + return true; + } + + const char *pager_cmd = getenv("PAGER"); + if (pager_cmd == NULL) { + pager_cmd = "less"; + } + if (pager_cmd[0] == '\0') { + return true; // an empty string disables the pager + } + + int pipe_fds[2]; + if (pipe(pipe_fds) != 0) { + perror("pipe() failed"); + return false; + } + + pid_t pid = fork(); + if (pid < 0) { + perror("fork() failed"); + return false; + } else if (pid == 0) { + close(pipe_fds[1]); + pager_exec(pager_cmd, pipe_fds[0]); + } + + // Create a new process group for the child, give it control over the + // terminal + pid_t pgid = pid; + if (setpgid(pid, pgid) != 0) { + perror("setpgid() failed"); + return false; + } + if (tcsetpgrp(STDIN_FILENO, pgid) != 0) { + perror("tcsetpgrp() failed"); + return false; + } + + // Make it so our stdout goes to the pager + if (dup2(pipe_fds[1], STDOUT_FILENO) < 0) { + perror("dup2() failed"); + return false; + } + + close(pipe_fds[0]); + close(pipe_fds[1]); + close(STDIN_FILENO); + + *pager = (struct pager){ .pid = pid }; + return true; +} + +bool pager_close(struct pager *pager) { + if (pager->pid <= 0) { + return true; + } + + fflush(stdout); + fclose(stdout); + + // Wait until the pager finishes + while (true) { + int stat; + if (waitpid(pager->pid, &stat, 0) < 0) { + if (errno == EINTR) { + continue; + } + perror("waitpid() failed"); + return false; + } + return WIFEXITED(stat) && WEXITSTATUS(stat) == 0; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/drm_info-v2.10.0/pager.h new/drm_info-v2.11.0/pager.h --- old/drm_info-v2.10.0/pager.h 1970-01-01 01:00:00.000000000 +0100 +++ new/drm_info-v2.11.0/pager.h 2026-11-29 15:07:04.000000000 +0100 @@ -0,0 +1,14 @@ +#ifndef PAGER_H +#define PAGER_H + +#include <stdbool.h> +#include <sys/types.h> + +struct pager { + pid_t pid; +}; + +bool pager_start(struct pager *pager); +bool pager_close(struct pager *pager); + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/drm_info-v2.10.0/pretty.c new/drm_info-v2.11.0/pretty.c --- old/drm_info-v2.10.0/pretty.c 2026-06-03 14:36:30.000000000 +0200 +++ new/drm_info-v2.11.0/pretty.c 2026-11-29 15:07:04.000000000 +0100 @@ -641,6 +641,19 @@ } } +static void print_background_color(struct json_object *obj, const char *prefix) +{ + double r = json_object_get_double(json_object_object_get(obj, "r")); + double g = json_object_get_double(json_object_object_get(obj, "g")); + double b = json_object_get_double(json_object_object_get(obj, "b")); + double a = json_object_get_double(json_object_object_get(obj, "a")); + + printf("%s" L_VAL "Red: %f\n", prefix, r); + printf("%s" L_VAL "Green: %f\n", prefix, g); + printf("%s" L_VAL "Blue: %f\n", prefix, b); + printf("%s" L_LAST "Alpha: %f\n", prefix, a); +} + static void print_properties(struct json_object *obj, const char *prefix) { printf("%s" L_LAST "Properties\n", prefix); @@ -693,10 +706,16 @@ else printf("%"PRIu64"]", max); - if (data_obj != NULL) - printf(" = %"PRIu64"\n", json_object_get_uint64(data_obj)); + if (strncmp(prop_name, "SRC_", 4) == 0) + printf(" = %f (0x%"PRIx64")\n", json_object_get_double(data_obj), raw_val); + else if (data_obj) + printf(" = 0x%"PRIx64"\n", raw_val); else - printf(" = %"PRIu64"\n", json_object_get_uint64(val_obj)); + printf(" = %"PRIu64"\n", raw_val); + + if (strcmp(prop_name, "BACKGROUND_COLOR") == 0) { + print_background_color(data_obj, sub_prefix); + } break; case DRM_MODE_PROP_ENUM: printf("enum {"); @@ -724,6 +743,7 @@ } else { printf("invalid (%"PRIu64")\n", raw_val); } + if (strcmp(prop_name, "COLOR_PIPELINE") == 0) { print_color_pipeline(data_obj, sub_prefix); } @@ -810,10 +830,7 @@ else printf("%"PRIi64"]", smax); - if (data_obj != NULL) - printf(" = %"PRIi64"\n", json_object_get_int64(data_obj)); - else - printf(" = %"PRIi64"\n", json_object_get_int64(val_obj)); + printf(" = %"PRIi64"\n", json_object_get_int64(val_obj)); break; default: printf("unknown type (%"PRIu32") = %"PRIu64"\n", type, raw_val);
