From owner-svn-ports-all@freebsd.org Sat Aug 20 18:43:31 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90E43BC0B9B; Sat, 20 Aug 2016 18:43:31 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5263D1DBE; Sat, 20 Aug 2016 18:43:31 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KIhUsi086357; Sat, 20 Aug 2016 18:43:30 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KIhTlq086348; Sat, 20 Aug 2016 18:43:29 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201608201843.u7KIhTlq086348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Sat, 20 Aug 2016 18:43:29 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r420524 - in head/sysutils: . read-edid read-edid/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Aug 2016 18:43:31 -0000 Author: danfe Date: Sat Aug 20 18:43:29 2016 New Revision: 420524 URL: https://svnweb.freebsd.org/changeset/ports/420524 Log: Add a port of read-edid utility, a pair of tools for reading the EDID from a monitor. It is mostly useful to read LCD matrix manufacturer and model. WWW: http://www.polypux.org/projects/read-edid/ NB: TIMESTAMP line in distinfo should read as follows, but has to stay in its current form due to a bug in the hook script: TIMESTAMP (read-edid-3.0.2.tar.gz) = 1430271430 Added: head/sysutils/read-edid/ head/sysutils/read-edid/Makefile (contents, props changed) head/sysutils/read-edid/distinfo (contents, props changed) head/sysutils/read-edid/files/ head/sysutils/read-edid/files/patch-CMakeLists.txt (contents, props changed) head/sysutils/read-edid/files/patch-get-edid_classic.c (contents, props changed) head/sysutils/read-edid/files/patch-get-edid_i2c-dev.h (contents, props changed) head/sysutils/read-edid/files/patch-get-edid_i2c.c (contents, props changed) head/sysutils/read-edid/pkg-descr (contents, props changed) head/sysutils/read-edid/pkg-message (contents, props changed) Modified: head/sysutils/Makefile Modified: head/sysutils/Makefile ============================================================================== --- head/sysutils/Makefile Sat Aug 20 18:39:58 2016 (r420523) +++ head/sysutils/Makefile Sat Aug 20 18:43:29 2016 (r420524) @@ -888,6 +888,7 @@ SUBDIR += rdiff-backup SUBDIR += rdiff-backup-devel SUBDIR += rdup + SUBDIR += read-edid SUBDIR += realsync SUBDIR += recoverdm SUBDIR += reed Added: head/sysutils/read-edid/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/Makefile Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,19 @@ +# Created by: Alexey Dokuchaev +# $FreeBSD$ + +PORTNAME= read-edid +PORTVERSION= 3.0.2 +CATEGORIES= sysutils +MASTER_SITES= http://www.polypux.org/projects/${PORTNAME}/ + +MAINTAINER= danfe@FreeBSD.org +COMMENT= Tools for reading the EDID from a monitor + +LIB_DEPENDS= libx86.so:devel/libx86 + +USES= cmake localbase + +PLIST_FILES= bin/get-edid bin/parse-edid man/man1/get-edid.1.gz +PORTDOCS= AUTHORS ChangeLog LICENSE README + +.include Added: head/sysutils/read-edid/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/distinfo Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,3 @@ +TIMESTAMP = 1430271430 +SHA256 (read-edid-3.0.2.tar.gz) = c7c6d8440f5b90f98e276829271ccea5b2ff5a3413df8a0f87ec09f834af186f +SIZE (read-edid-3.0.2.tar.gz) = 17508 Added: head/sysutils/read-edid/files/patch-CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/files/patch-CMakeLists.txt Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,11 @@ +--- CMakeLists.txt.orig 2014-02-05 16:27:26 UTC ++++ CMakeLists.txt +@@ -12,6 +12,6 @@ if (I2CBUILD OR CLASSICBUILD) + endif () + add_subdirectory (parse-edid) + +-INSTALL(FILES get-edid.1 DESTINATION share/man/man1) +-INSTALL(FILES AUTHORS ChangeLog COPYING README DESTINATION ++INSTALL(FILES get-edid.1 DESTINATION man/man1) ++INSTALL(FILES AUTHORS ChangeLog LICENSE README DESTINATION + share/doc/read-edid) Added: head/sysutils/read-edid/files/patch-get-edid_classic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/files/patch-get-edid_classic.c Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,34 @@ +--- get-edid/classic.c.orig 2015-04-29 01:08:34 UTC ++++ get-edid/classic.c +@@ -1,12 +1,12 @@ + /* (c) 2000,2001,2002 John Fremlin */ + /* (c) 2010,2011 Matthew Kern */ + #ifdef CLASSICBUILD ++#include + #include + #include + #include + #include + #include +-#include + #include + + #include +@@ -135,8 +135,17 @@ classicmain( unsigned contr, int qit ) + return 10; + } + ++#if defined(__linux__) + ioperm(0, 0x400 , 1); + iopl(3); ++#elif defined(__FreeBSD__) ++#define DEV_IO_PATH "/dev/io" ++ if (open(DEV_IO_PATH, O_RDONLY) < 0) { ++ display("%s(): failed to open %s\n", __func__, DEV_IO_PATH); ++ return 11; ++ } ++#undef DEV_IO_PATH ++#endif + + + /*if ( argc == 1 ) Added: head/sysutils/read-edid/files/patch-get-edid_i2c-dev.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/files/patch-get-edid_i2c-dev.h Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,21 @@ +--- get-edid/i2c-dev.h.orig 2011-10-04 19:57:18 UTC ++++ get-edid/i2c-dev.h +@@ -25,9 +25,17 @@ + #ifndef LIB_I2CDEV_H + #define LIB_I2CDEV_H + +-#include ++#include + #include + ++#if defined(__FreeBSD__) ++typedef int8_t __s8; ++typedef int16_t __s16; ++typedef int32_t __s32; ++typedef uint8_t __u8; ++typedef uint16_t __u16; ++typedef uint32_t __u32; ++#endif + + /* -- i2c.h -- */ + Added: head/sysutils/read-edid/files/patch-get-edid_i2c.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/files/patch-get-edid_i2c.c Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,17 @@ +--- get-edid/i2c.c.orig 2014-11-21 11:52:13 UTC ++++ get-edid/i2c.c +@@ -24,7 +24,13 @@ int open_i2c_dev(int i2cbus) { + char filename[16]; + unsigned long funcs; + +- sprintf(filename, "/dev/i2c-%d", i2cbus); ++ sprintf(filename, ++#if defined(__linux__) ++ "/dev/i2c-%d", ++#elif defined(__FreeBSD__) ++ "/dev/iic%d", ++#endif ++ i2cbus); + i2cfile = open(filename, O_RDWR); + + if (i2cfile < 0 && errno == ENOENT) { Added: head/sysutils/read-edid/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/pkg-descr Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,9 @@ +read-edid is a pair of tools (originally by John Fremlin) for reading the +EDID from a monitor. It should work with most monitors made since 1996, +assuming the video card supports the standard read commands (most do). + +Two tools are provided: get-edid, which gets the raw EDID information from +the monitor, and parse-edid, which turns the raw binary information into a +xorg.conf-compatible monitor section (or xrandr-compatible modelines). + +WWW: http://www.polypux.org/projects/read-edid/ Added: head/sysutils/read-edid/pkg-message ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/pkg-message Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,13 @@ +FreeBSD has mapping at zero address feature turned off since 8.0-RC2: + + http://security.freebsd.org/advisories/FreeBSD-EN-09:05.null.asc + +This is required to read EDID data via classical VBE interface (to avoid +"mmap /dev/mem: Invalid argument" message from libx86). To temporarily +disable this protection, issue the following command: + + # sysctl security.bsd.map_at_zero=1 + +To return to secure state: + + # sysctl security.bsd.map_at_zero=0