Binary files /tmp/pitqAhFXQb/edid-decode-0.1~git20100205.26c03c8e/data/oculus-rift-dk1-hdmi and /tmp/s3zx0f4Mjf/edid-decode-0.1~git20140128.afcf2a2e/data/oculus-rift-dk1-hdmi differ Binary files /tmp/pitqAhFXQb/edid-decode-0.1~git20100205.26c03c8e/data/samsung-UE40D8000YU-hmdi and /tmp/s3zx0f4Mjf/edid-decode-0.1~git20140128.afcf2a2e/data/samsung-UE40D8000YU-hmdi differ Binary files /tmp/pitqAhFXQb/edid-decode-0.1~git20100205.26c03c8e/data/skyworth-50e780u-hdmi and /tmp/s3zx0f4Mjf/edid-decode-0.1~git20140128.afcf2a2e/data/skyworth-50e780u-hdmi differ diff -Nru edid-decode-0.1~git20100205.26c03c8e/debian/changelog edid-decode-0.1~git20140128.afcf2a2e/debian/changelog --- edid-decode-0.1~git20100205.26c03c8e/debian/changelog 2015-07-06 08:11:13.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/debian/changelog 2015-06-29 11:36:11.000000000 +0000 @@ -1,3 +1,13 @@ +edid-decode (0.1~git20140128.afcf2a2e-1) unstable; urgency=medium + + * First upload to Debian. + * New upstream snapshot. + * New maintainer. + * Update debian/rules to use the debhelper short form. + * Patch Makefile to use proper flags. + + -- Andrew Shadura Mon, 29 Jun 2015 13:27:23 +0200 + edid-decode (0.1~git20100205.26c03c8e-0ubuntu3) natty; urgency=low * The package depends on debhelper >= 7; hence, set debian/compat to "7" diff -Nru edid-decode-0.1~git20100205.26c03c8e/debian/compat edid-decode-0.1~git20140128.afcf2a2e/debian/compat --- edid-decode-0.1~git20100205.26c03c8e/debian/compat 2015-07-06 08:11:13.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/debian/compat 2015-06-29 11:36:00.000000000 +0000 @@ -1 +1 @@ -7 +9 diff -Nru edid-decode-0.1~git20100205.26c03c8e/debian/control edid-decode-0.1~git20140128.afcf2a2e/debian/control --- edid-decode-0.1~git20100205.26c03c8e/debian/control 2015-07-06 08:11:13.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/debian/control 2015-06-29 11:36:00.000000000 +0000 @@ -1,12 +1,11 @@ Source: edid-decode Section: x11 Priority: optional -Maintainer: Ubuntu Developers +Maintainer: Andrew Shadura Build-Depends: - debhelper (>= 7), + debhelper (>= 9), pkg-config, - dpkg-dev (>= 1.14.17) -Standards-Version: 3.9.1 +Standards-Version: 3.9.6 Package: edid-decode Architecture: any @@ -15,4 +14,3 @@ EDID is binary data encoded in the monitor firmware, which the kernel exposes via /sys/devices/.../drm/card*/card*/edid. edid-decode renders this binary data into a human-readable text form. - . diff -Nru edid-decode-0.1~git20100205.26c03c8e/debian/edid-decode.install edid-decode-0.1~git20140128.afcf2a2e/debian/edid-decode.install --- edid-decode-0.1~git20100205.26c03c8e/debian/edid-decode.install 2015-07-06 08:11:13.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/debian/edid-decode.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/bin/* diff -Nru edid-decode-0.1~git20100205.26c03c8e/debian/patches/00-fix-makefile.patch edid-decode-0.1~git20140128.afcf2a2e/debian/patches/00-fix-makefile.patch --- edid-decode-0.1~git20100205.26c03c8e/debian/patches/00-fix-makefile.patch 1970-01-01 00:00:00.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/debian/patches/00-fix-makefile.patch 2015-06-29 11:36:06.000000000 +0000 @@ -0,0 +1,16 @@ +diff --git a/Makefile b/Makefile +index c064a14..4e916c1 100644 +--- a/Makefile ++++ b/Makefile +@@ -4,11 +4,9 @@ bindir ?= /usr/bin + mandir ?= /usr/share/man + + edid-decode: edid-decode.c +- $(CC) -g -Wall -o $@ $< + + clean: + rm -f edid-decode +- -echo rm -f edid-decode **/*.jx | zsh -s + + install: + mkdir -p $(DESTDIR)$(bindir) diff -Nru edid-decode-0.1~git20100205.26c03c8e/debian/patches/series edid-decode-0.1~git20140128.afcf2a2e/debian/patches/series --- edid-decode-0.1~git20100205.26c03c8e/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/debian/patches/series 2015-06-29 11:36:06.000000000 +0000 @@ -0,0 +1 @@ +00-fix-makefile.patch diff -Nru edid-decode-0.1~git20100205.26c03c8e/debian/rules edid-decode-0.1~git20140128.afcf2a2e/debian/rules --- edid-decode-0.1~git20100205.26c03c8e/debian/rules 2015-07-06 08:11:13.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/debian/rules 2015-06-29 11:36:00.000000000 +0000 @@ -1,83 +1,7 @@ #!/usr/bin/make -f -# Copyright © 2004 Scott James Remnant -# Copyright © 2005 Daniel Stone -# Copyright © 2005 David Nusinow # uncomment this to turn off verbose mode. #export DH_VERBOSE=1 -include debian/xsfbs/xsfbs.mk - -CFLAGS = -Wall -g -fvisibility=hidden -ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif - -DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) - confflags += --build=$(DEB_HOST_GNU_TYPE) -else - confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) -endif - -configure: $(STAMP_DIR) - dh_testdir - -obj-$(DEB_BUILD_GNU_TYPE)/config.status: configure - dh_testdir - -.PHONY: build -build: build-stamp -build-stamp: obj-$(DEB_BUILD_GNU_TYPE)/config.status - dh_testdir - $(MAKE) - >$@ - -# clean: clean-patched unpatch -# rm -rf .pc -# rm -r stampdir -# clean-patched: -# dh_testdir -# dh_testroot -# rm -f build-stamp -# dh_clean - -install: build - dh_testdir - dh_testroot - dh_prep - dh_installdirs - - test -d $(CURDIR)/debian/tmp/usr/bin || mkdir -p $(CURDIR)/debian/tmp/usr/bin - cp edid-decode $(CURDIR)/debian/tmp/usr/bin/ - -# Build architecture-dependent files here. -binary-arch: DH_OPTIONS=-s -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_install --sourcedir=debian/tmp --list-missing --exclude=.la --exclude=usr/share/man/man4 - dh_installman - dh_installudev - dh_link - dh_strip -pedid-decode - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps -- --warnings=6 - dh_gencontrol - dh_md5sums - dh_builddeb - -# Build architecture-independent files here. -binary-indep: build install -# Nothing to do - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install +%: + dh "$@" diff -Nru edid-decode-0.1~git20100205.26c03c8e/debian/source/format edid-decode-0.1~git20140128.afcf2a2e/debian/source/format --- edid-decode-0.1~git20100205.26c03c8e/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/debian/source/format 2015-06-29 11:38:57.000000000 +0000 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru edid-decode-0.1~git20100205.26c03c8e/debian/xsfbs/repack.sh edid-decode-0.1~git20140128.afcf2a2e/debian/xsfbs/repack.sh --- edid-decode-0.1~git20100205.26c03c8e/debian/xsfbs/repack.sh 2015-07-06 08:11:13.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/debian/xsfbs/repack.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -#!/bin/sh - -set -e - -if ! [ -d debian/prune ]; then - exit 0 -fi - -if [ "x$1" != x--upstream-version ]; then - exit 1 -fi - -version="$2" -filename="$3" - -if [ -z "$version" ] || ! [ -f "$filename" ]; then - exit 1 -fi - -dir="$(pwd)" -tempdir="$(mktemp -d)" - -cd "$tempdir" -tar xf "$dir/$filename" -cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done - -tar czf "$dir/$filename" * -cd "$dir" -rm -rf "$tempdir" -echo "Done pruning upstream tarball" - -exit 0 diff -Nru edid-decode-0.1~git20100205.26c03c8e/debian/xsfbs/xsfbs.mk edid-decode-0.1~git20140128.afcf2a2e/debian/xsfbs/xsfbs.mk --- edid-decode-0.1~git20100205.26c03c8e/debian/xsfbs/xsfbs.mk 2015-07-06 08:11:13.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/debian/xsfbs/xsfbs.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,293 +0,0 @@ -#!/usr/bin/make -f - -# Debian X Strike Force Build System (XSFBS): Make portion - -# Copyright 1996 Stephen Early -# Copyright 1997 Mark Eichin -# Copyright 1998-2005, 2007 Branden Robinson -# Copyright 2005 David Nusinow -# -# Licensed under the GNU General Public License, version 2. See the file -# /usr/share/common-licenses/GPL or . - -# Originally by Stephen Early -# Modified by Mark W. Eichin -# Modified by Adam Heath -# Modified by Branden Robinson -# Modified by Fabio Massimo Di Nitto -# Modified by David Nusinow -# Acknowledgements to Manoj Srivastava. - -# Pass $(DH_OPTIONS) into the environment for debhelper's benefit. -export DH_OPTIONS - -# force quilt to not use ~/.quiltrc and to use debian/patches -QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null - -# Set up parameters for the upstream build environment. - -# Determine (source) package name from Debian changelog. -SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \ - | grep '^Source:' | awk '{print $$2}') - -# Determine package version from Debian changelog. -SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \ - | grep '^Version:' | awk '{print $$2}') - -# Determine upstream version number. -UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//') - -# Determine the source version without the epoch for make-orig-tar-gz -NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://') - -# Figure out who's building this package. -BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}}) - -# Find out if this is an official build; an official build has nothing but -# digits, dots, and/or the codename of a release in the Debian part of the -# version number. Anything else indicates an unofficial build. -OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi) - -# Set up parameters for the Debian build environment. - -# Determine our architecture. -BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) -# Work around some old-time dpkg braindamage. -BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH)) -# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy. -ifdef DEB_HOST_ARCH - ARCH:=$(DEB_HOST_ARCH) -else - # dpkg-cross sets the ARCH environment variable; if set, use it. - ifdef ARCH - ARCH:=$(ARCH) - else - ARCH:=$(BUILD_ARCH) - endif -endif - -# $(STAMP_DIR) houses stamp files for complex targets. -STAMP_DIR:=stampdir - -# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place -# their files. -DEBTREEDIR:=$(CURDIR)/debian/tmp - -# All "important" targets have four lines: -# 1) A target name that is invoked by a package-building tool or the user. -# This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart. -# 2) A line delcaring 1) as a phony target (".PHONY:"). -# 3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may -# depend on other targets. -# 4) A line declaring 3) as a member of the $(stampdir_targets) variable; the -# "$(STAMP_DIR)/" prefix is omitted. -# -# This indirection is needed so that the "stamp" files that signify when a rule -# is done can be located in a separate "stampdir". Recall that make has no way -# to know when a goal has been met for a phony target (like "build" or -# "install"). -# -# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@" -# so that the target will not be run again. Removing the file will make Make -# run the target over. - -# All phony targets should be declared as dependencies of .PHONY, even if they -# do not have "($STAMP_DIR)/"-prefixed counterparts. - -# Define a harmless default rule to keep things from going nuts by accident. -.PHONY: default -default: - -# Set up the $(STAMP_DIR) directory. -.PHONY: stampdir -stampdir_targets+=stampdir -stampdir: $(STAMP_DIR)/stampdir -$(STAMP_DIR)/stampdir: - mkdir $(STAMP_DIR) - >$@ - -# Set up the package build directory as quilt expects to find it. -#.PHONY: prepare -#stampdir_targets+=prepare -#prepare: $(STAMP_DIR)/prepare -#$(STAMP_DIR)/prepare: $(STAMP_DIR)/log $(STAMP_DIR)/genscripts -# >$@ - -#.PHONY: log -#stampdir_targets+=log -#log: $(STAMP_DIR)/log -#$(STAMP_DIR)/log: $(STAMP_DIR)/stampdir -# mkdir -p $(STAMP_DIR)/log - -# Apply all patches to the upstream source. -# .PHONY: patch -#stampdir_targets+=patch -#patch: $(STAMP_DIR)/patch -#$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare -# if ! [ `which quilt` ]; then \ -# echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \ -# exit 1; \ -# fi; \ -# if $(QUILT) next >/dev/null 2>&1; then \ -# echo -n "Applying patches..."; \ -# if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \ -# cat $(STAMP_DIR)/log/patch; \ -# echo "successful."; \ -# else \ -# cat $(STAMP_DIR)/log/patch; \ -# echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \ -# exit 1; \ -# fi; \ -# else \ -# echo "No patches to apply"; \ -# fi; \ -# >$@ - -# Revert all patches to the upstream source. -# .PHONY: unpatch -#unpatch: $(STAMP_DIR)/log -# rm -f $(STAMP_DIR)/patch -# @echo -n "Unapplying patches..."; \ -# if $(QUILT) applied >/dev/null 2>/dev/null; then \ -# if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \ -# cat $(STAMP_DIR)/log/unpatch; \ -# echo "successful."; \ -# else \ -# cat $(STAMP_DIR)/log/unpatch; \ -# echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \ -# exit 1; \ -# fi; \ -# else \ -# echo "nothing to do."; \ -# fi - -# Clean the generated maintainer scripts. -.PHONY: cleanscripts -cleanscripts: - rm -f $(STAMP_DIR)/genscripts - rm -f debian/*.config \ - debian/*.postinst \ - debian/*.postrm \ - debian/*.preinst \ - debian/*.prerm - -# Clean the package build tree. -.PHONY: xsfclean -xsfclean: cleanscripts unpatch - dh_testdir - rm -rf .pc - rm -rf $(STAMP_DIR) $(SOURCE_DIR) - rm -rf imports - dh_clean debian/shlibs.local \ - debian/po/pothead - -# Generate the debconf templates POT file header. -debian/po/pothead: debian/po/pothead.in - sed -e 's/SOURCE_VERSION/$(SOURCE_VERSION)/' \ - -e 's/DATE/$(shell date "+%F %X%z"/)' <$< >$@ - -# Update POT and PO files. -.PHONY: updatepo -updatepo: debian/po/pothead - debian/scripts/debconf-updatepo --pot-header=pothead --verbose - -# Remove files from the upstream source tree that we don't need, or which have -# licensing problems. It must be run before creating the .orig.tar.gz. -# -# Note: This rule is for Debian package maintainers' convenience, and is not -# needed for conventional build scenarios. -.PHONY: prune-upstream-tree -prune-upstream-tree: - # Ensure we're in the correct directory. - dh_testdir - grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf - -# Verify that there are no offsets or fuzz in the patches we apply. -# -# Note: This rule is for Debian package maintainers' convenience, and is not -# needed for conventional build scenarios. -#.PHONY: patch-audit -#patch-audit: prepare unpatch -# @echo -n "Auditing patches..."; \ -# >$(STAMP_DIR)/log/patch; \ -# FUZZY=; \ -# while [ -n "$$($(QUILT) next)" ]; do \ -# RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\ -# case "$$RESULT" in \ -# succeeded) \ -# echo "fuzzy patch: $$($(QUILT) top)" \ -# | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \ -# FUZZY=yes; \ -# ;; \ -# FAILED) \ -# echo "broken patch: $$($(QUILT) next)" \ -# | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \ -# exit 1; \ -# ;; \ -# esac; \ -# done; \ -# if [ -n "$$FUZZY" ]; then \ -# echo "there were fuzzy patches; please fix."; \ -# exit 1; \ -# else \ -# echo "done."; \ -# fi - -# Generate the maintainer scripts. -.PHONY: genscripts -stampdir_targets+=genscripts -genscripts: $(STAMP_DIR)/genscripts -$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir - for FILE in debian/*.config.in \ - debian/*.postinst.in \ - debian/*.postrm.in \ - debian/*.preinst.in \ - debian/*.prerm.in; do \ - if [ -e "$$FILE" ]; then \ - MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \ - sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \ - | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \ - cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \ - sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \ - | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \ - sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \ - -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \ - -e 's/@DEFAULT_DCRESOLUTIONS@/$(DEFAULT_DCRESOLUTIONS)/' \ - <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \ - rm $$MAINTSCRIPT.tmp; \ - fi; \ - done - # Validate syntax of generated shell scripts. - #sh debian/scripts/validate-posix-sh debian/*.config \ - # debian/*.postinst \ - # debian/*.postrm \ - # debian/*.preinst \ - # debian/*.prerm - >$@ - -# Generate the shlibs.local file. -debian/shlibs.local: - cat debian/*.shlibs >$@ - -SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null) -VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null) -INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null) -SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS)) -VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI) -INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI) -ifeq ($(PACKAGE),) -PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control) -endif - -.PHONY: serverabi -serverabi: install -ifeq ($(SERVERMINVERS),) - @echo error: xserver-xorg-dev needs to be installed - @exit 1 -else - echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/$(PACKAGE).substvars - echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars - echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars -endif - -# vim:set noet ai sts=8 sw=8 tw=0: diff -Nru edid-decode-0.1~git20100205.26c03c8e/debian/xsfbs/xsfbs.sh edid-decode-0.1~git20140128.afcf2a2e/debian/xsfbs/xsfbs.sh --- edid-decode-0.1~git20100205.26c03c8e/debian/xsfbs/xsfbs.sh 2015-07-06 08:11:13.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/debian/xsfbs/xsfbs.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,853 +0,0 @@ -# $Id$ - -# This is the X Strike Force shell library for X Window System package -# maintainer scripts. It serves to define shell functions commonly used by -# such packages, and performs some error checking necessary for proper operation -# of those functions. By itself, it does not "do" much; the maintainer scripts -# invoke the functions defined here to accomplish package installation and -# removal tasks. - -# If you are reading this within a Debian package maintainer script (e.g., -# /var/lib/dpkg)info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can -# skip past this library by scanning forward in this file to the string -# "GOBSTOPPER". - -SOURCE_VERSION=@SOURCE_VERSION@ -OFFICIAL_BUILD=@OFFICIAL_BUILD@ - -# Use special abnormal exit codes so that problems with this library are more -# easily tracked down. -SHELL_LIB_INTERNAL_ERROR=86 -SHELL_LIB_THROWN_ERROR=74 -SHELL_LIB_USAGE_ERROR=99 - -# old -> new variable names -if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then - DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE" -fi -if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then - DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF" -fi - -# initial sanity checks -if [ -z "$THIS_PACKAGE" ]; then - cat >&2 < on the World Wide Web for -instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the -"doc-debian" package, or install the "reportbug" package and use the command of -the same name to file a report against version $SOURCE_VERSION of this package. -EOF - exit $SHELL_LIB_USAGE_ERROR -fi - -if [ -z "$THIS_SCRIPT" ]; then - cat >&2 < on the World Wide Web for -instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the -"doc-debian" package, or install the "reportbug" package and use the command of -the same name to file a report against version $SOURCE_VERSION of the -"$THIS_PACKAGE" package. -EOF - exit $SHELL_LIB_USAGE_ERROR -fi - -if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then - RECONFIGURE="true" -else - RECONFIGURE= -fi - -if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then - FIRSTINST="yes" -fi - -if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then - UPGRADE="yes" -fi - -trap "message;\ - message \"Received signal. Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\ - message;\ - exit 1" HUP INT QUIT TERM - -reject_nondigits () { - # syntax: reject_nondigits [ operand ... ] - # - # scan operands (typically shell variables whose values cannot be trusted) for - # characters other than decimal digits and barf if any are found - while [ -n "$1" ]; do - # does the operand contain anything but digits? - if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then - # can't use die(), because it wraps message() which wraps this function - echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \ - "possibly malicious garbage \"$1\"" >&2 - exit $SHELL_LIB_THROWN_ERROR - fi - shift - done -} - -reject_whitespace () { - # syntax: reject_whitespace [ operand ] - # - # scan operand (typically a shell variable whose value cannot be trusted) for - # whitespace characters and barf if any are found - if [ -n "$1" ]; then - # does the operand contain any whitespace? - if expr "$1" : "[[:space:]]" > /dev/null 2>&1; then - # can't use die(), because I want to avoid forward references - echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_whitespace() encountered" \ - "possibly malicious garbage \"$1\"" >&2 - exit $SHELL_LIB_THROWN_ERROR - fi - fi -} - -reject_unlikely_path_chars () { - # syntax: reject_unlikely_path_chars [ operand ... ] - # - # scan operands (typically shell variables whose values cannot be trusted) for - # characters unlikely to be seen in a path and which the shell might - # interpret and barf if any are found - while [ -n "$1" ]; do - # does the operand contain any funny characters? - if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then - # can't use die(), because I want to avoid forward references - echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \ - "encountered possibly malicious garbage \"$1\"" >&2 - exit $SHELL_LIB_THROWN_ERROR - fi - shift - done -} - -# Query the terminal to establish a default number of columns to use for -# displaying messages to the user. This is used only as a fallback in the -# event the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while -# the script is running, and this cannot, only being calculated once.) -DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true -if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then - DEFCOLUMNS=80 -fi - -message () { - # pretty-print messages of arbitrary length - reject_nondigits "$COLUMNS" - echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2 -} - -observe () { - # syntax: observe message ... - # - # issue observational message suitable for logging someday when support for - # it exists in dpkg - if [ -n "$DEBUG_XORG_PACKAGE" ]; then - message "$THIS_PACKAGE $THIS_SCRIPT note: $*" - fi -} - -warn () { - # syntax: warn message ... - # - # issue warning message suitable for logging someday when support for - # it exists in dpkg; also send to standard error - message "$THIS_PACKAGE $THIS_SCRIPT warning: $*" -} - -die () { - # syntax: die message ... - # - # exit script with error message - message "$THIS_PACKAGE $THIS_SCRIPT error: $*" - exit $SHELL_LIB_THROWN_ERROR -} - -internal_error () { - # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message - message "internal error: $*" - if [ -n "$OFFICIAL_BUILD" ]; then - message "Please report a bug in the $THIS_SCRIPT script of the" \ - "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \ - "Tracking System. Include all messages above that mention the" \ - "$THIS_PACKAGE package. Visit " \ - " on the World Wide Web for" \ - "instructions, read the file" \ - "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \ - "package, or install the reportbug package and use the command of" \ - "the same name to file a report." - fi - exit $SHELL_LIB_INTERNAL_ERROR -} - -usage_error () { - message "usage error: $*" - message "Please report a bug in the $THIS_SCRIPT script of the" \ - "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \ - "Tracking System. Include all messages above that mention the" \ - "$THIS_PACKAGE package. Visit " \ - " on the World Wide Web for" \ - "instructions, read the file" \ - "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \ - "package, or install the reportbug package and use the command of" \ - "the same name to file a report." - exit $SHELL_LIB_USAGE_ERROR -} - - -maplink () { - # returns what symlink should point to; i.e., what the "sane" answer is - # Keep this in sync with the debian/*.links files. - # This is only needed for symlinks to directories. - # - # XXX: Most of these look wrong in the X11R7 world and need to be fixed. - # If we've stopped using this function, fixing it might enable us to re-enable - # it again and catch more errors. - case "$1" in - /etc/X11/xkb/compiled) echo /var/lib/xkb ;; - /etc/X11/xkb/xkbcomp) echo /usr/X11R6/bin/xkbcomp ;; - /usr/X11R6/lib/X11/app-defaults) echo /etc/X11/app-defaults ;; - /usr/X11R6/lib/X11/fs) echo /etc/X11/fs ;; - /usr/X11R6/lib/X11/lbxproxy) echo /etc/X11/lbxproxy ;; - /usr/X11R6/lib/X11/proxymngr) echo /etc/X11/proxymngr ;; - /usr/X11R6/lib/X11/rstart) echo /etc/X11/rstart ;; - /usr/X11R6/lib/X11/twm) echo /etc/X11/twm ;; - /usr/X11R6/lib/X11/xdm) echo /etc/X11/xdm ;; - /usr/X11R6/lib/X11/xinit) echo /etc/X11/xinit ;; - /usr/X11R6/lib/X11/xkb) echo /etc/X11/xkb ;; - /usr/X11R6/lib/X11/xserver) echo /etc/X11/xserver ;; - /usr/X11R6/lib/X11/xsm) echo /etc/X11/xsm ;; - /usr/bin/X11) echo ../X11R6/bin ;; - /usr/bin/rstartd) echo ../X11R6/bin/rstartd ;; - /usr/include/X11) echo ../X11R6/include/X11 ;; - /usr/lib/X11) echo ../X11R6/lib/X11 ;; - *) internal_error "maplink() called with unknown path \"$1\"" ;; - esac -} - -analyze_path () { - # given a supplied set of pathnames, break each one up by directory and do an - # ls -dl on each component, cumulatively; i.e. - # analyze_path /usr/X11R6/bin -> ls -dl /usr /usr/X11R6 /usr/X11R6/bin - # Thanks to Randolph Chung for this clever hack. - - local f g - - while [ -n "$1" ]; do - reject_whitespace "$1" - g= - message "Analyzing $1:" - for f in $(echo "$1" | tr / \ ); do - if [ -e /$g$f ]; then - ls -dl /$g$f /$g$f.dpkg-* 2> /dev/null || true - g=$g$f/ - else - message "/$g$f: nonexistent; directory contents of /$g:" - ls -l /$g - break - fi - done - shift - done -} - -find_culprits () { - local f p dpkg_info_dir possible_culprits smoking_guns bad_packages package \ - msg - - reject_whitespace "$1" - message "Searching for overlapping packages..." - dpkg_info_dir=/var/lib/dpkg/info - if [ -d $dpkg_info_dir ]; then - if [ "$(echo $dpkg_info_dir/*.list)" != "$dpkg_info_dir/*.list" ]; then - possible_culprits=$(ls -1 $dpkg_info_dir/*.list | egrep -v \ - "(xbase-clients|x11-common|xfs|xlibs)") - if [ -n "$possible_culprits" ]; then - smoking_guns=$(grep -l "$1" $possible_culprits || true) - if [ -n "$smoking_guns" ]; then - bad_packages=$(printf "\\n") - for f in $smoking_guns; do - # too bad you can't nest parameter expansion voodoo - p=${f%*.list} # strip off the trailing ".list" - package=${p##*/} # strip off the directories - bad_packages=$(printf "%s\n%s" "$bad_packages" "$package") - done - msg=$(cat < /dev/null 2>&1; then - shortcmd=${cmd##*/} - observe "running $shortcmd in $dir font directory" - cmd_opts= - if [ "$shortcmd" = "update-fonts-alias" ]; then - cmd_opts=--x11r7-layout - fi - if [ "$shortcmd" = "update-fonts-dir" ]; then - cmd_opts=--x11r7-layout - fi - if [ "$shortcmd" = "update-fonts-scale" ]; then - cmd_opts=--x11r7-layout - fi - $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \ - "failed; font directory data may not" \ - "be up to date" - else - warn "$cmd not found; not updating corresponding $dir font" \ - "directory data" - fi - done - else - warn "$dir is not a directory; not updating font directory data" - fi - done -} - -remove_conffile_prepare () { - # syntax: remove_conffile_prepare filename official_md5sum ... - # - # Check a conffile "filename" against a list of canonical MD5 checksums. - # If the file's current MD5 checksum matches one of the "official_md5sum" - # operands provided, then prepare the conffile for removal from the system. - # We defer actual deletion until the package is configured so that we can - # roll this operation back if package installation fails. - # - # Call this function from a preinst script in the event $1 is "upgrade" or - # "install" and verify $2 to ensure the package is being upgraded from a - # version (or installed over a version removed-but-not-purged) prior to the - # one in which the conffile was obsoleted. - - local conffile current_checksum - - # validate arguments - if [ $# -lt 2 ]; then - usage_error "remove_conffile_prepare() called with wrong number of" \ - "arguments; expected at least 2, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - conffile="$1" - shift - - # does the conffile even exist? - if [ -e "$conffile" ]; then - # calculate its checksum - current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//') - # compare it to each supplied checksum - while [ -n "$1" ]; do - if [ "$current_checksum" = "$1" ]; then - # we found a match; move the confffile and stop looking - observe "preparing obsolete conffile $conffile for removal" - mv "$conffile" "$conffile.$THIS_PACKAGE-tmp" - break - fi - shift - done - fi -} - -remove_conffile_lookup () { - # syntax: remove_conffile_lookup package filename - # - # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal - # if it matches the actual file's md5sum. - # - # Call this function when you would call remove_conffile_prepare but only - # want to check against dpkg's status database instead of known checksums. - - local package conffile old_md5sum - - # validate arguments - if [ $# -ne 2 ]; then - usage_error "remove_conffile_lookup() called with wrong number of" \ - "arguments; expected 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - package="$1" - conffile="$2" - - if ! [ -e "$conffile" ]; then - return - fi - old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \ - awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')" - if [ -n "$old_md5sum" ]; then - remove_conffile_prepare "$conffile" "$old_md5sum" - fi -} - -remove_conffile_commit () { - # syntax: remove_conffile_commit filename - # - # Complete the removal of a conffile "filename" that has become obsolete. - # - # Call this function from a postinst script after having used - # remove_conffile_prepare() in the preinst. - - local conffile - - # validate arguments - if [ $# -ne 1 ]; then - usage_error "remove_conffile_commit() called with wrong number of" \ - "arguments; expected 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - conffile="$1" - - # if the temporary file created by remove_conffile_prepare() exists, remove it - if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then - observe "committing removal of obsolete conffile $conffile" - rm "$conffile.$THIS_PACKAGE-tmp" - fi -} - -remove_conffile_rollback () { - # syntax: remove_conffile_rollback filename - # - # Roll back the removal of a conffile "filename". - # - # Call this function from a postrm script in the event $1 is "abort-upgrade" - # or "abort-install" is after having used remove_conffile_prepare() in the - # preinst. - - local conffile - - # validate arguments - if [ $# -ne 1 ]; then - usage_error "remove_conffile_rollback() called with wrong number of" \ - "arguments; expected 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - conffile="$1" - - # if the temporary file created by remove_conffile_prepare() exists, move it - # back - if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then - observe "rolling back removal of obsolete conffile $conffile" - mv "$conffile.$THIS_PACKAGE-tmp" "$conffile" - fi -} - -replace_conffile_with_symlink_prepare () { - # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \ - # official_md5sum ... - # - # Check a conffile "oldfilename" against a list of canonical MD5 checksums. - # If the file's current MD5 checksum matches one of the "official_md5sum" - # operands provided, then prepare the conffile for removal from the system. - # We defer actual deletion until the package is configured so that we can - # roll this operation back if package installation fails. Otherwise copy it - # to newfilename and let dpkg handle it through conffiles mechanism. - # - # Call this function from a preinst script in the event $1 is "upgrade" or - # "install" and verify $2 to ensure the package is being upgraded from a - # version (or installed over a version removed-but-not-purged) prior to the - # one in which the conffile was obsoleted. - - local conffile current_checksum - - # validate arguments - if [ $# -lt 3 ]; then - usage_error "replace_conffile_with_symlink_prepare() called with wrong" \ - " number of arguments; expected at least 3, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - oldconffile="$1" - shift - newconffile="$1" - shift - - remove_conffile_prepare "$_oldconffile" "$@" - # If $oldconffile still exists, then md5sums didn't match. - # Copy it to new one. - if [ -f "$oldconffile" ]; then - cp "$oldconffile" "$newconffile" - fi - -} - -replace_conffile_with_symlink_commit () { - # syntax: replace_conffile_with_symlink_commit oldfilename - # - # Complete the removal of a conffile "oldfilename" that has been - # replaced by a symlink. - # - # Call this function from a postinst script after having used - # replace_conffile_with_symlink_prepare() in the preinst. - - local conffile - - # validate arguments - if [ $# -ne 1 ]; then - usage_error "replace_conffile_with_symlink_commit() called with wrong" \ - "number of arguments; expected 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - conffile="$1" - - remove_conffile_commit "$conffile" -} - -replace_conffile_with_symlink_rollback () { - # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename - # - # Roll back the replacing of a conffile "oldfilename" with symlink to - # "newfilename". - # - # Call this function from a postrm script in the event $1 is "abort-upgrade" - # or "abort-install" and verify $2 to ensure the package failed to upgrade - # from a version (or install over a version removed-but-not-purged) prior - # to the one in which the conffile was obsoleted. - # You should have used replace_conffile_with_symlink_prepare() in the - # preinst. - - local conffile - - # validate arguments - if [ $# -ne 2 ]; then - usage_error "replace_conffile_with_symlink_rollback() called with wrong" \ - "number of arguments; expected 2, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - oldconffile="$1" - newconffile="$2" - - remove_conffile_rollback "$_oldconffile" - if [ -f "$newconffile" ]; then - rm "$newconffile" - fi -} - -run () { - # syntax: run command [ argument ... ] - # - # Run specified command with optional arguments and report its exit status. - # Useful for commands whose exit status may be nonzero, but still acceptable, - # or commands whose failure is not fatal to us. - # - # NOTE: Do *not* use this function with db_get or db_metaget commands; in - # those cases the return value of the debconf command *must* be checked - # before the string returned by debconf is used for anything. - - local retval - - # validate arguments - if [ $# -lt 1 ]; then - usage_error "run() called with wrong number of arguments; expected at" \ - "least 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - "$@" || retval=$? - - if [ ${retval:-0} -ne 0 ]; then - observe "command \"$*\" exited with status $retval" - fi -} - -make_symlink_sane () { - # syntax: make_symlink_sane symlink target - # - # Ensure that the symbolic link symlink exists, and points to target. - # - # If symlink does not exist, create it and point it at target. - # - # If symlink exists but is not a symbolic link, back it up. - # - # If symlink exists, is a symbolic link, but points to the wrong location, fix - # it. - # - # If symlink exists, is a symbolic link, and already points to target, do - # nothing. - # - # This function wouldn't be needed if ln had an -I, --idempotent option. - - # Validate arguments. - if [ $# -ne 2 ]; then - usage_error "make_symlink_sane() called with wrong number of arguments;" \ - "expected 2, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - # We could just use the positional parameters as-is, but that makes things - # harder to follow. - local symlink target - - symlink="$1" - target="$2" - - if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then - observe "link from $symlink to $target already exists" - else - observe "creating symbolic link from $symlink to $target" - mkdir -p "${target%/*}" "${symlink%/*}" - ln -s -b -S ".dpkg-old" "$target" "$symlink" - fi -} - -migrate_dir_to_symlink () { - # syntax: migrate_dir_to_symlink old_location new_location - # - # Per Debian Policy section 6.5.4, "A directory will never be replaced by a - # symbolic link to a directory or vice versa; instead, the existing state - # (symlink or not) will be left alone and dpkg will follow the symlink if - # there is one." - # - # We have to do it ourselves. - # - # This function moves the contents of old_location, a directory, into - # new_location, a directory, then makes old_location a symbolic link to - # new_location. - # - # old_location need not exist, but if it does, it must be a directory (or a - # symlink to a directory). If it is not, it is backed up. If new_location - # exists already and is not a directory, it is backed up. - # - # This function should be called from a package's preinst so that other - # packages unpacked after this one --- but before this package's postinst runs - # --- are unpacked into new_location even if their payloads contain - # old_location filespecs. - - # Validate arguments. - if [ $# -ne 2 ]; then - usage_error "migrate_dir_to_symlink() called with wrong number of" - "arguments; expected 2, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - # We could just use the positional parameters as-is, but that makes things - # harder to follow. - local new old - - old="$1" - new="$2" - - # Is old location a symlink? - if [ -L "$old" ]; then - # Does it already point to new location? - if [ "$(readlink "$old")" = "$new" ]; then - # Nothing to do; migration has already been done. - observe "migration of $old to $new already done" - return 0 - else - # Back it up. - warn "backing up symbolic link $old as $old.dpkg-old" - mv -b "$old" "$old.dpkg-old" - fi - fi - - # Does old location exist, but is not a directory? - if [ -e "$old" ] && ! [ -d "$old" ]; then - # Back it up. - warn "backing up non-directory $old as $old.dpkg-old" - mv -b "$old" "$old.dpkg-old" - fi - - observe "migrating $old to $new" - - # Is new location a symlink? - if [ -L "$new" ]; then - # Does it point the wrong way, i.e., back to where we're migrating from? - if [ "$(readlink "$new")" = "$old" ]; then - # Get rid of it. - observe "removing symbolic link $new which points to $old" - rm "$new" - else - # Back it up. - warn "backing up symbolic link $new as $new.dpkg-old" - mv -b "$new" "$new.dpkg-old" - fi - fi - - # Does new location exist, but is not a directory? - if [ -e "$new" ] && ! [ -d "$new" ]; then - warn "backing up non-directory $new as $new.dpkg-old" - mv -b "$new" "$new.dpkg-old" - fi - - # Create new directory if it does not yet exist. - if ! [ -e "$new" ]; then - observe "creating $new" - mkdir -p "$new" - fi - - # Copy files in old location to new location. Back up any filenames that - # already exist in the new location with the extension ".dpkg-old". - observe "copying files from $old to $new" - if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then - die "error(s) encountered while copying files from $old to $new" - fi - - # Remove files at old location. - observe "removing $old" - rm -r "$old" - - # Create symlink from old location to new location. - make_symlink_sane "$old" "$new" -} - -# vim:set ai et sw=2 ts=2 tw=80: - -# GOBSTOPPER: The X Strike Force shell library ends here. diff -Nru edid-decode-0.1~git20100205.26c03c8e/edid-decode.1 edid-decode-0.1~git20140128.afcf2a2e/edid-decode.1 --- edid-decode-0.1~git20100205.26c03c8e/edid-decode.1 1970-01-01 00:00:00.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/edid-decode.1 2014-01-29 17:08:18.000000000 +0000 @@ -0,0 +1,43 @@ +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH edid-decode 1 +.SH NAME +edid-decode - Decode EDID data in human-readable format +.SH SYNOPSIS +.B edid-decode [in] [out] +.SH DESCRIPTION +.B edid-decode +decodes EDID monitor description data in human-readable format. It takes +zero, one, or two arguments. If invoked with no arguments it reads from +standard input and writes to standard output. With one argument, the file +named by the argument is read instead. With two arguments, normal output +is suppressed, and the binary EDID blob is written to the file named by +the second argument. +.PP +Input files may be raw binaries or ASCII text. ASCII input is scanned for +hex dumps; heuristics are included to search for hexdumps in +.B xrandr(1) +property output and +.B Xorg(1) +log file formats, otherwise the data is treated as a raw hexdump. EDID blocks +for connected monitors can be found in +.B /sys/class/drm/*/edid +on modern Linux systems with kernel modesetting support. +.PP +.SH NOTES +Not all fields are decoded, or decoded completely. Some fields' decoding +may appear to corrupt the output (for example, detailed string sections +have their contents printed literally). +.B edid-decode +does attempt to validate its input against the relevant standards, but its +opinions have not been double-checked with the relevant standards bodies, +so they may be wrong. Do not rely on the output format, as it will likely +change in future versions of the tool as additional fields and extensions are +added. +.SH "SEE ALSO" +Xorg(1), xrandr(1) +.SH AUTHORS +edid-decode was written by Adam Jackson, with contributions from Eric +Anholt, Damien Lespiau, and others. For complete history and the latest +version, see +.B http://cgit.freedesktop.org/xorg/app/edid-decode/ diff -Nru edid-decode-0.1~git20100205.26c03c8e/edid-decode.c edid-decode-0.1~git20140128.afcf2a2e/edid-decode.c --- edid-decode-0.1~git20100205.26c03c8e/edid-decode.c 2010-11-17 01:29:35.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/edid-decode.c 2014-01-29 17:08:18.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright 2006-2009 Red Hat, Inc. + * Copyright 2006-2012 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -32,6 +32,8 @@ #include #include +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x))) + static int claims_one_point_oh = 0; static int claims_one_point_two = 0; static int claims_one_point_three = 0; @@ -54,6 +56,7 @@ static int has_valid_descriptor_pad = 1; static int has_valid_range_descriptor = 1; static int has_valid_max_dotclock = 1; +static int has_valid_string_termination = 1; static int manufacturer_name_well_formed = 0; static int seen_non_detailed_descriptor = 0; @@ -62,6 +65,73 @@ static int conformant = 1; +struct value { + int value; + const char *description; +}; + +struct field { + const char *name; + int start, end; + struct value *values; + int n_values; +}; + +#define DEFINE_FIELD(n, var, s, e, ...) \ + static struct value var##_values[] = { \ + __VA_ARGS__ \ + }; \ + static struct field var = { \ + .name = n, \ + .start = s, \ + .end = e, \ + .values = var##_values, \ + .n_values = ARRAY_SIZE(var##_values), \ + } + +static void +decode_value(struct field *field, int val, const char *prefix) +{ + struct value *v; + int i; + + for (i = 0; i < field->n_values; i++) { + v = &field->values[i]; + + if (v->value == val) + break; + } + + if (i == field->n_values) { + printf("%s%s: %d\n", prefix, field->name, val); + return; + } + + printf("%s%s: %s (%d)\n", prefix, field->name, v->description, val); +} + +static void +_decode(struct field **fields, int n_fields, int data, const char *prefix) +{ + int i; + + for (i = 0; i < n_fields; i++) { + struct field *f = fields[i]; + int field_length = f->end - f->start + 1; + int val; + + if (field_length == 32) + val = data; + else + val = (data >> f->start) & ((1 << field_length) - 1); + + decode_value(f, val, prefix); + } +} + +#define decode(fields, data, prefix) \ + _decode(fields, ARRAY_SIZE(fields), data, prefix) + static char *manufacturer_name(unsigned char *x) { static char name[4]; @@ -134,6 +204,36 @@ return valid; } +/* extract a string from a detailed subblock, checking for termination */ +static char * +extract_string(unsigned char *x, int *valid_termination, int len) +{ + static char ret[128]; + int i, seen_newline = 0; + + memset(ret, 0, sizeof(ret)); + + for (i = 0; i < len; i++) { + if (isalnum(x[i])) { + ret[i] = x[i]; + } else if (!seen_newline) { + if (x[i] == 0x0a) { + seen_newline = 1; + } else { + *valid_termination = 0; + return ret; + } + } else { + if (x[i] != 0x20) { + *valid_termination = 0; + return ret; + } + } + } + + return ret; +} + /* 1 means valid data */ static int detailed_block(unsigned char *x, int in_extension) @@ -141,7 +241,7 @@ static unsigned char name[53]; int ha, hbl, hso, hspw, hborder, va, vbl, vso, vspw, vborder; int i; - char phsync, pvsync, *syncmethod; + char phsync, pvsync, *syncmethod, *stereo; #if 0 printf("Hex of detail: "); @@ -219,7 +319,9 @@ strncat((char *)name, (char *)x + 5, 13); if (strchr((char *)name, '\n')) { name_descriptor_terminated = 1; - printf("Monitor name: %s", name); + printf("Monitor name: %s\n", + extract_string(name, &has_valid_string_termination, + strlen((char *)name))); } return 1; case 0xFD: @@ -228,6 +330,7 @@ int v_max_offset = 0, v_min_offset = 0; int is_cvt = 0; has_range_descriptor = 1; + char *range_class = ""; /* * XXX todo: implement feature flags, vtd blocks * XXX check: ranges are well-formed; block termination if no vtd @@ -251,19 +354,28 @@ /* * despite the values, this is not a bitfield. - * XXX only 0x00 and 0x02 are legal for pre-1.4 */ switch (x[10]) { case 0x00: /* default gtf */ + range_class = "GTF"; break; case 0x01: /* range limits only */ + range_class = "bare limits"; + if (!claims_one_point_four) + has_valid_range_descriptor = 0; break; case 0x02: /* secondary gtf curve */ + range_class = "GTF with icing"; break; case 0x04: /* cvt */ + range_class = "CVT"; is_cvt = 1; + if (!claims_one_point_four) + has_valid_range_descriptor = 0; break; default: /* invalid */ + has_valid_range_descriptor = 0; + range_class = "invalid"; break; } @@ -271,7 +383,8 @@ has_valid_range_descriptor = 0; if (x[7] + h_min_offset > x[8] + h_max_offset) has_valid_range_descriptor = 0; - printf("Monitor ranges: %d-%dHZ vertical, %d-%dkHz horizontal", + printf("Monitor ranges (%s): %d-%dHz V, %d-%dkHz H", + range_class, x[5] + v_min_offset, x[6] + v_max_offset, x[7] + h_min_offset, x[8] + h_max_offset); if (x[9]) @@ -359,15 +472,15 @@ } case 0xFE: /* - * TODO: Two of these in a row, in the third and fouth slots, + * TODO: Two of these in a row, in the third and fourth slots, * seems to be specified by SPWG: http://www.spwg.org/ */ - /* XXX check: terminated with 0x0A, padded with 0x20 */ - printf("ASCII string: %s", x+5); + printf("ASCII string: %s\n", + extract_string(x + 5, &has_valid_string_termination, 13)); return 1; case 0xFF: - /* XXX check: terminated with 0x0A, padded with 0x20 */ - printf("Serial number: %s", x+5); + printf("Serial number: %s\n", + extract_string(x + 5, &has_valid_string_termination, 13)); return 1; default: printf("Unknown monitor description type %d\n", x[3]); @@ -406,17 +519,41 @@ } pvsync = (x[17] & (1 << 2)) ? '+' : '-'; phsync = (x[17] & (1 << 1)) ? '+' : '-'; + switch (x[17] & 0x61) { + case 0x20: + stereo = "field sequential L/R"; + break; + case 0x40: + stereo = "field sequential R/L"; + break; + case 0x21: + stereo = "interleaved right even"; + break; + case 0x41: + stereo = "interleaved left even"; + break; + case 0x60: + stereo = "four way interleaved"; + break; + case 0x61: + stereo = "side by side interleaved"; + break; + default: + stereo = ""; + break; + } printf("Detailed mode: Clock %.3f MHz, %d mm x %d mm\n" " %4d %4d %4d %4d hborder %d\n" " %4d %4d %4d %4d vborder %d\n" - " %chsync %cvsync%s%s\n", + " %chsync %cvsync%s%s %s\n", (x[0] + (x[1] << 8)) / 100.0, (x[12] + ((x[14] & 0xF0) << 4)), (x[13] + ((x[14] & 0x0F) << 8)), ha, ha + hso, ha + hso + hspw, ha + hbl, hborder, va, va + vso, va + vso + vspw, va + vbl, vborder, - phsync, pvsync, syncmethod, x[17] & 0x80 ? " interlaced" : "" + phsync, pvsync, syncmethod, x[17] & 0x80 ? " interlaced" : "", + stereo ); /* XXX flag decode */ @@ -435,23 +572,168 @@ if (sum) { printf(" (should be 0x%hx)", (unsigned char)(x[0x7f] - sum)); has_valid_checksum = 0; - } + } else printf(" (valid)"); } printf("\n"); } /* CEA extension */ +static const char * +audio_format(unsigned char x) +{ + switch (x) { + case 0: return "RESERVED"; + case 1: return "Linear PCM"; + case 2: return "AC-3"; + case 3: return "MPEG 1 (Layers 1 & 2)"; + case 4: return "MPEG 1 Layer 3 (MP3)"; + case 5: return "MPEG2 (multichannel)"; + case 6: return "AAC"; + case 7: return "DTS"; + case 8: return "ATRAC"; + case 9: return "One Bit Audio"; + case 10: return "Dolby Digital+"; + case 11: return "DTS-HD"; + case 12: return "MAT (MLP)"; + case 13: return "DST"; + case 14: return "WMA Pro"; + case 15: return "RESERVED"; + } + return "BROKEN"; /* can't happen */ +} + +static void +cea_audio_block(unsigned char *x) +{ + int i, format; + int length = x[0] & 0x1f; + + if (length % 3) { + printf("Broken CEA audio block length %d\n", length); + /* XXX non-conformant */ + return; + } + + for (i = 1; i < length; i += 3) { + format = (x[i] & 0x78) >> 3; + printf(" %s, max channels %d\n", audio_format(format), + x[i] & 0x07); + printf(" Supported sample rates (kHz):%s%s%s%s%s%s%s\n", + (x[i+1] & 0x40) ? " 192" : "", + (x[i+1] & 0x20) ? " 176.4" : "", + (x[i+1] & 0x10) ? " 96" : "", + (x[i+1] & 0x08) ? " 88.2" : "", + (x[i+1] & 0x04) ? " 48" : "", + (x[i+1] & 0x02) ? " 44.1" : "", + (x[i+1] & 0x01) ? " 32" : ""); + if (format == 1) { + printf(" Supported sample sizes (bits):%s%s%s\n", + (x[2] & 0x04) ? " 24" : "", + (x[2] & 0x02) ? " 20" : "", + (x[2] & 0x01) ? " 16" : ""); + } else if (format <= 8) { + printf(" Maximum bit rate: %d kHz\n", x[2] * 8); + } + } +} + +static const char *edid_cea_modes[] = { + "640x480@60Hz", + "720x480@60Hz", + "720x480@60Hz", + "1280x720@60Hz", + "1920x1080i@60Hz", + "1440x480i@60Hz", + "1440x480i@60Hz", + "1440x240@60Hz", + "1440x240@60Hz", + "2880x480i@60Hz", + "2880x480i@60Hz", + "2880x240@60Hz", + "2880x240@60Hz", + "1440x480@60Hz", + "1440x480@60Hz", + "1920x1080@60Hz", + "720x576@50Hz", + "720x576@50Hz", + "1280x720@50Hz", + "1920x1080i@50Hz", + "1440x576i@50Hz", + "1440x576i@50Hz", + "1440x288@50Hz", + "1440x288@50Hz", + "2880x576i@50Hz", + "2880x576i@50Hz", + "2880x288@50Hz", + "2880x288@50Hz", + "1440x576@50Hz", + "1440x576@50Hz", + "1920x1080@50Hz", + "1920x1080@24Hz", + "1920x1080@25Hz", + "1920x1080@30Hz", + "2880x480@60Hz", + "2880x480@60Hz", + "2880x576@50Hz", + "2880x576@50Hz", + "1920x1080i@50Hz", + "1920x1080i@100Hz", + "1280x720@100Hz", + "720x576@100Hz", + "720x576@100Hz", + "1440x576@100Hz", + "1440x576@100Hz", + "1920x1080i@120Hz", + "1280x720@120Hz", + "720x480@120Hz", + "720x480@120Hz", + "1440x480i@120Hz", + "1440x480i@120Hz", + "720x576@200Hz", + "720x576@200Hz", + "1440x576i@200Hz", + "1440x576i@200Hz", + "720x480@240Hz", + "720x480@240Hz", + "1440x480i@240Hz", + "1440x480i@240Hz", + "1280x720@24Hz", + "1280x720@25Hz", + "1280x720@30Hz", + "1920x1080@120Hz", + "1920x1080@100Hz", +}; + static void cea_video_block(unsigned char *x) { int i; int length = x[0] & 0x1f; - for (i = 1; i < length; i++) - printf(" VIC %02d %s\n", x[i] & 0x7f, x[i] & 0x80 ? "(native)" : ""); + for (i = 1; i <= length; i++) { + unsigned char vic = x[i] & 0x7f; + unsigned char native = x[i] & 0x80; + const char *mode; + int index; + + index = vic - 1; + if (index < ARRAY_SIZE(edid_cea_modes)) + mode = edid_cea_modes[index]; + else + mode = "Unknown mode"; + + printf(" VIC %02d %s %s\n", vic, mode, native ? "(native)" : ""); + } } +static const char *edid_cea_hdmi_modes[] = { + "3840x2160@30Hz", + "3840x2160@25Hz", + "3840x2160@24Hz", + "4096x2160@24Hz", +}; + static void cea_hdmi_block(unsigned char *x) { @@ -480,7 +762,185 @@ if (length > 6) printf(" Maximum TMDS clock: %dMHz\n", x[7] * 5); - /* latency info */ + /* XXX the walk here is really ugly, and needs to be length-checked */ + if (length > 7) { + int b = 0; + + if (x[8] & 0x80) { + printf(" Video latency: %d\n", x[9 + b]); + printf(" Audio latency: %d\n", x[10 + b]); + b += 2; + } + + if (x[8] & 0x40) { + printf(" Interlaced video latency: %d\n", x[9 + b]); + printf(" Interlaced audio latency: %d\n", x[10 + b]); + b += 2; + } + + if (x[8] & 0x20) { + int mask = 0, formats = 0; + int len_vic, len_3d; + printf(" Extended HDMI video details:\n"); + if (x[9 + b] & 0x80) + printf(" 3D present\n"); + if ((x[9 + b] & 0x60) == 0x20) { + printf(" All advertised VICs are 3D-capable\n"); + formats = 1; + } + if ((x[9 + b] & 0x60) == 0x40) { + printf(" 3D-capable-VIC mask present\n"); + formats = 1; + mask = 1; + } + switch (x[9 + b] & 0x18) { + case 0x00: break; + case 0x08: + printf(" Base EDID image size is aspect ratio\n"); + break; + case 0x10: + printf(" Base EDID image size is in units of 1cm\n"); + break; + case 0x18: + printf(" Base EDID image size is in units of 5cm\n"); + break; + } + len_vic = (x[10 + b] & 0xe0) >> 5; + len_3d = (x[10 + b] & 0x1f) >> 0; + b += 2; + + if (len_vic) { + int i; + + for (i = 0; i < len_vic; i++) { + unsigned char vic = x[9 + b + i]; + const char *mode; + + vic--; + if (vic < ARRAY_SIZE(edid_cea_hdmi_modes)) + mode = edid_cea_hdmi_modes[vic]; + else + mode = "Unknown mode"; + + printf(" HDMI VIC %d %s\n", vic, mode); + } + + b += len_vic; + } + + if (len_3d) { + if (formats) { + /* 3D_Structure_ALL_15..8 */ + if (x[9 + b] & 0x80) + printf(" 3D: Side-by-side (half, quincunx)\n"); + if (x[9 + b] & 0x01) + printf(" 3D: Side-by-side (half, horizontal)\n"); + /* 3D_Structure_ALL_7..0 */ + if (x[10 + b] & 0x40) + printf(" 3D: Top-and-bottom\n"); + if (x[10 + b] & 0x20) + printf(" 3D: L + depth + gfx + gfx-depth\n"); + if (x[10 + b] & 0x10) + printf(" 3D: L + depth\n"); + if (x[10 + b] & 0x08) + printf(" 3D: Side-by-side (full)\n"); + if (x[10 + b] & 0x04) + printf(" 3D: Line-alternative\n"); + if (x[10 + b] & 0x02) + printf(" 3D: Field-alternative\n"); + if (x[10 + b] & 0x01) + printf(" 3D: Frame-packing\n"); + b += 2; + len_3d -= 2; + } + if (mask) { + int i; + printf(" 3D VIC indices:"); + /* worst bit ordering ever */ + for (i = 0; i < 8; i++) + if (x[10 + b] & (1 << i)) + printf(" %d", i); + for (i = 0; i < 8; i++) + if (x[9 + b] & (1 << i)) + printf(" %d", i + 8); + printf("\n"); + b += 2; + len_3d -= 2; + } + + /* + * list of nibbles: + * 2D_VIC_Order_X + * 3D_Structure_X + * (optionally: 3D_Detail_X and reserved) + */ + if (len_3d > 0) { + int end = b + len_3d; + + while (b < end) { + printf(" VIC index %d supports ", x[9 + b] >> 4); + switch (x[9 + b] & 0x0f) { + case 0: printf("frame packing"); break; + case 6: printf("top-and-bottom"); break; + case 8: + if ((x[10 + b] >> 4) == 1) { + printf("side-by-side (half, horizontal)"); + break; + } + default: printf("unknown"); + } + printf("\n"); + + if ((x[9 + b] & 0x0f) > 7) { + /* Optional 3D_Detail_X and reserved */ + b++; + } + b++; + } + } + + } + + } + } +} + +DEFINE_FIELD("YCbCr quantization", YCbCr_quantization, 7, 7, + { 0, "No Data" }, + { 1, "Selectable (via AVI YQ)" }); +DEFINE_FIELD("RGB quantization", RGB_quantization, 6, 6, + { 0, "No Data" }, + { 1, "Selectable (via AVI Q)" }); +DEFINE_FIELD("PT scan behaviour", PT_scan, 4, 5, + { 0, "No Data" }, + { 1, "Always Overscannned" }, + { 2, "Always Underscanned" }, + { 3, "Support both over- and underscan" }); +DEFINE_FIELD("IT scan behaviour", IT_scan, 2, 3, + { 0, "IT video formats not supported" }, + { 1, "Always Overscannned" }, + { 2, "Always Underscanned" }, + { 3, "Support both over- and underscan" }); +DEFINE_FIELD("CE scan behaviour", CE_scan, 0, 1, + { 0, "CE video formats not supported" }, + { 1, "Always Overscannned" }, + { 2, "Always Underscanned" }, + { 3, "Support both over- and underscan" }); + +static struct field *vcdb_fields[] = { + &YCbCr_quantization, + &RGB_quantization, + &PT_scan, + &IT_scan, + &CE_scan, +}; + +static void +cea_vcdb(unsigned char *x) +{ + unsigned char d = x[2]; + + decode(vcdb_fields, d, " "); } static void @@ -491,6 +951,7 @@ switch ((x[0] & 0xe0) >> 5) { case 0x01: printf(" Audio data block\n"); + cea_audio_block(x); break; case 0x02: printf(" Video data block\n"); @@ -516,6 +977,7 @@ switch (x[1]) { case 0x00: printf("video capability data block\n"); + cea_vcdb(x); break; case 0x01: printf("vendor-specific video data block\n"); @@ -660,53 +1122,87 @@ int out_index = 0; int len, size; - ret = malloc(1024); - size = 1024; + size = 1 << 10; + ret = malloc(size); len = 0; + + if (ret == NULL) + return NULL; + for (;;) { i = read(fd, ret + len, size - len); if (i < 0) { free(ret); - return 0; + return NULL; } if (i == 0) break; len += i; - if (len == size) - ret = realloc(ret, size + 1024); - } - - /* Look for xrandr --verbose output (8 lines of 16 hex bytes) */ - if ((start = strstr(ret, "EDID_DATA:")) != NULL) { + if (len == size) { + char *t; + size <<= 1; + t = realloc(ret, size); + if (t == NULL) { + free(ret); + return NULL; + } + ret = t; + } + } + + start = strstr(ret, "EDID_DATA:"); + if (start == NULL) + start = strstr(ret, "EDID:"); + /* Look for xrandr --verbose output (lines of 16 hex bytes) */ + if (start != NULL) { const char indentation1[] = " "; const char indentation2[] = "\t\t"; + /* Used to detect that we've gone past the EDID property */ + const char half_indentation1[] = " "; + const char half_indentation2[] = "\t"; const char *indentation; - unsigned char *out; char *s; - out = malloc(128); - if (out == NULL) - return NULL; - - for (i = 0; i < 8; i++) { + lines = 0; + for (i = 0;; i++) { int j; - /* Get the next start of the line of EDID hex. */ + /* Get the next start of the line of EDID hex, assuming spaces for indentation */ s = strstr(start, indentation = indentation1); - if (!s) + /* Did we skip the start of another property? */ + if (s && s > strstr(start, half_indentation1)) + break; + + /* If we failed, retry assuming tabs for indentation */ + if (!s) { s = strstr(start, indentation = indentation2); - if (s == NULL) { + /* Did we skip the start of another property? */ + if (s && s > strstr(start, half_indentation2)) + break; + } + + if (!s) + break; + + lines++; + start = s + strlen(indentation); + + s = realloc(out, lines * 16); + if (!s) { free(ret); free(out); return NULL; } - start = s + strlen(indentation); - + out = (unsigned char *)s; c = start; for (j = 0; j < 16; j++) { char buf[3]; /* Read a %02x from the log */ if (!isxdigit(c[0]) || !isxdigit(c[1])) { + if (j != 0) { + lines--; + break; + } free(ret); free(out); return NULL; @@ -720,6 +1216,42 @@ } free(ret); + edid_lines = lines; + return out; + } + + /* Is the EDID provided in hex? */ + for (i = 0; i < 32 && isxdigit(ret[i]); i++); + if (i == 32) { + out = malloc(size >> 1); + if (out == NULL) { + free(ret); + return NULL; + } + + for (c=ret; *c; c++) { + char buf[3]; + + if (*c == '\n') + continue; + + /* Read a %02x from the log */ + if (!isxdigit(c[0]) || !isxdigit(c[1])) { + free(ret); + free(out); + return NULL; + } + + buf[0] = c[0]; + buf[1] = c[1]; + buf[2] = 0; + + out[out_index++] = strtol(buf, NULL, 16); + c++; + } + + free(ret); + edid_lines = out_index >> 4; return out; } @@ -739,15 +1271,26 @@ for (c = start; *c; c++) { if (state == 0) { + char *s; /* skip ahead to the : */ - if (!(c = strstr(c, ": \t"))) + s = strstr(c, ": \t"); + if (!s) + s = strstr(c, ": "); + if (!s) break; + c = s; /* and find the first number */ while (!isxdigit(c[1])) c++; state = 1; lines++; - out = realloc(out, lines * 16); + s = realloc(out, lines * 16); + if (!s) { + free(ret); + free(out); + return NULL; + } + out = (unsigned char *)s; } else if (state == 1) { char buf[3]; /* Read a %02x from the log */ @@ -829,20 +1372,37 @@ int main(int argc, char **argv) { - int fd; + int fd, ofd; unsigned char *edid; unsigned char *x; time_t the_time; struct tm *ptm; int analog, i; - if (argc != 2) { - fd = 0; - } else { - if ((fd = open(argv[1], O_RDONLY)) == -1) { - perror(argv[1]); + switch (argc) { + case 1: + fd = 0; + ofd = -1; + break; + case 2: + if ((fd = open(argv[1], O_RDONLY)) == -1) { + perror(argv[1]); + return 1; + } + break; + case 3: + if ((fd = open(argv[1], O_RDONLY)) == -1) { + perror(argv[1]); + return 1; + } + if ((ofd = open(argv[2], O_WRONLY)) == -1) { + perror(argv[2]); + return 1; + } + break; + default: + fprintf(stderr, "What do you want from me?\n"); return 1; - } } edid = extract_edid(fd); @@ -853,6 +1413,11 @@ if (fd != 0) close(fd); + if (ofd != -1) { + write(ofd, edid, edid_lines * 16); + close(ofd); + } + dump_breakdown(edid); if (!edid || memcmp(edid, "\x00\xFF\xFF\xFF\xFF\xFF\xFF\x00", 8)) { @@ -1045,7 +1610,10 @@ x = (b1 + 31) * 8; switch ((b2 >> 6) & 0x3) { case 0x00: - y = x * 10 / 16; + if (claims_one_point_three) + y = x * 10 / 16; + else + y = x; break; case 0x01: y = x * 3 / 4; @@ -1054,7 +1622,7 @@ y = x * 4 / 5; break; case 0x03: - y = x * 9 / 15; + y = x * 9 / 16; break; } refresh = 60 + (b2 & 0x3f); @@ -1085,11 +1653,12 @@ x = edid; for (edid_lines /= 8; edid_lines > 1; edid_lines--) { x += 128; - nonconformant_digital_display += parse_extension(x); + nonconformant_extension += parse_extension(x); } if (claims_one_point_three) { if (nonconformant_digital_display || + !has_valid_string_termination || !has_valid_descriptor_pad || !has_name_descriptor || !name_descriptor_terminated || @@ -1111,6 +1680,8 @@ printf("\tMissing monitor ranges\n"); if (!has_valid_descriptor_pad) /* Might be more than just 1.3 */ printf("\tInvalid descriptor block padding\n"); + if (!has_valid_string_termination) /* Likewise */ + printf("\tDetailed block string not properly terminated\n"); } else if (claims_one_point_two) { if (nonconformant_digital_display || (has_name_descriptor && !name_descriptor_terminated)) @@ -1145,7 +1716,8 @@ conformant = 0; printf("EDID block does not conform at all!\n"); if (nonconformant_extension) - printf("\tHas at least one nonconformant extension block\n"); + printf("\tHas %d nonconformant extension block(s)\n", + nonconformant_extension); if (!has_valid_checksum) printf("\tBlock has broken checksum\n"); if (!has_valid_cvt) @@ -1179,3 +1751,58 @@ return !conformant; } + +/* + * Notes on panel extensions: (TODO, implement me in the code) + * + * EPI: http://www.epi-standard.org/fileadmin/spec/EPI_Specification1.0.pdf + * at offset 0x6c (fourth detailed block): (all other bits reserved) + * 0x6c: 00 00 00 0e 00 + * 0x71: bit 6-5: data color mapping (00 conventional/fpdi/vesa, 01 openldi) + * bit 4-3: pixels per clock (00 1, 01 2, 10 4, 11 reserved) + * bit 2-0: bits per pixel (000 18, 001 24, 010 30, else reserved) + * 0x72: bit 5: FPSCLK polarity (0 normal 1 inverted) + * bit 4: DE polarity (0 high active 1 low active) + * bit 3-0: interface (0000 LVDS TFT + * 0001 mono STN 4/8bit + * 0010 color STN 8/16 bit + * 0011 18 bit tft + * 0100 24 bit tft + * 0101 tmds + * else reserved) + * 0x73: bit 1: horizontal display mode (0 normal 1 right/left reverse) + * bit 0: vertical display mode (0 normal 1 up/down reverse) + * 0x74: bit 7-4: total poweroff seq delay (0000 vga controller default + * else time in 10ms (10ms to 150ms)) + * bit 3-0: total poweron seq delay (as above) + * 0x75: contrast power on/off seq delay, same as 0x74 + * 0x76: bit 7: backlight control enable (1 means this field is valid) + * bit 6: backlight enabled at boot (0 on 1 off) + * bit 5-0: backlight brightness control steps (0..63) + * 0x77: bit 7: contrast control, same bit pattern as 0x76 except bit 6 resvd + * 0x78 - 0x7c: reserved + * 0x7d: bit 7-4: EPI descriptor major version (1) + * bit 3-0: EPI descriptor minor version (0) + * + * ---- + * + * SPWG: http://www.spwg.org/spwg_spec_version3.8_3-14-2007.pdf + * + * Since these are "dummy" blocks, terminate with 0a 20 20 20 ... as usual + * + * detailed descriptor 3: + * 0x5a - 0x5e: 00 00 00 fe 00 + * 0x5f - 0x63: PC maker part number + * 0x64: LCD supplier revision # + * 0x65 - 0x6b: manufacturer part number + * + * detailed descriptor 4: + * 0x6c - 0x70: 00 00 00 fe 00 + * 0x71 - 0x78: smbus nits values (whut) + * 0x79: number of lvds channels (1 or 2) + * 0x7A: panel self test (1 if present) + * and then dummy terminator + * + * SPWG also says something strange about the LSB of detailed descriptor 1: + * "LSB is set to "1" if panel is DE-timing only. H/V can be ignored." + */ diff -Nru edid-decode-0.1~git20100205.26c03c8e/.gitignore edid-decode-0.1~git20140128.afcf2a2e/.gitignore --- edid-decode-0.1~git20100205.26c03c8e/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/.gitignore 2014-01-29 17:08:18.000000000 +0000 @@ -0,0 +1,2 @@ +edid-decode +*.jx diff -Nru edid-decode-0.1~git20100205.26c03c8e/Makefile edid-decode-0.1~git20140128.afcf2a2e/Makefile --- edid-decode-0.1~git20100205.26c03c8e/Makefile 2010-11-17 01:29:35.000000000 +0000 +++ edid-decode-0.1~git20140128.afcf2a2e/Makefile 2014-01-29 17:08:18.000000000 +0000 @@ -1,9 +1,10 @@ # ZSH OR DIE, PUNKS bindir ?= /usr/bin +mandir ?= /usr/share/man edid-decode: edid-decode.c - gcc -g -Wall -o $@ $< + $(CC) -g -Wall -o $@ $< clean: rm -f edid-decode @@ -12,3 +13,5 @@ install: mkdir -p $(DESTDIR)$(bindir) install -m 0755 edid-decode $(DESTDIR)$(bindir) + mkdir -p $(DESTDIR)$(mandir)/man1 + install -m 0644 edid-decode.1 $(DESTDIR)$(mandir)/man1