diff options
author | Manuel Rüger <mrueg@gentoo.org> | 2014-03-31 00:49:57 +0000 |
---|---|---|
committer | Manuel Rüger <mrueg@gentoo.org> | 2014-03-31 00:49:57 +0000 |
commit | 0c676d7a59a75847a04153c4fc82efee19ae3a37 (patch) | |
tree | 9aab55b3a8a19f9f142dd506bfea6e8223153500 /app-misc | |
parent | Move p.u.s.m masks from default/linux/{amd64,x86}/13.0/ to arch/{amd64,x86}/. (diff) | |
download | gentoo-2-0c676d7a59a75847a04153c4fc82efee19ae3a37.tar.gz gentoo-2-0c676d7a59a75847a04153c4fc82efee19ae3a37.tar.bz2 gentoo-2-0c676d7a59a75847a04153c4fc82efee19ae3a37.zip |
Cleanup old. Drop stable ppc keyword.
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key )
Diffstat (limited to 'app-misc')
-rw-r--r-- | app-misc/ddccontrol/ChangeLog | 10 | ||||
-rw-r--r-- | app-misc/ddccontrol/ddccontrol-0.4.2-r1.ebuild | 73 | ||||
-rw-r--r-- | app-misc/ddccontrol/ddccontrol-0.4.2-r2.ebuild | 80 | ||||
-rw-r--r-- | app-misc/ddccontrol/ddccontrol-0.4.2_p20130703.ebuild | 76 | ||||
-rw-r--r-- | app-misc/ddccontrol/files/ddccontrol-0.4.2-automake.patch | 60 | ||||
-rw-r--r-- | app-misc/ddccontrol/files/ddccontrol-0.4.2-no-ddcpci.patch | 14 | ||||
-rw-r--r-- | app-misc/ddccontrol/files/ddccontrol-0.4.2-pciutils-libz.patch | 19 | ||||
-rw-r--r-- | app-misc/ddccontrol/files/ddccontrol-0.4.2-support-fglrx.patch | 606 |
8 files changed, 9 insertions, 929 deletions
diff --git a/app-misc/ddccontrol/ChangeLog b/app-misc/ddccontrol/ChangeLog index 364149315e16..00e2a0694b8c 100644 --- a/app-misc/ddccontrol/ChangeLog +++ b/app-misc/ddccontrol/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-misc/ddccontrol # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-misc/ddccontrol/ChangeLog,v 1.38 2014/03/12 05:03:55 phajdan.jr Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-misc/ddccontrol/ChangeLog,v 1.39 2014/03/31 00:49:57 mrueg Exp $ + + 30 Mar 2014; Manuel Rüger <mrueg@gentoo.org> -ddccontrol-0.4.2-r1.ebuild, + -ddccontrol-0.4.2-r2.ebuild, -ddccontrol-0.4.2_p20130703.ebuild, + -files/ddccontrol-0.4.2-automake.patch, + -files/ddccontrol-0.4.2-no-ddcpci.patch, + -files/ddccontrol-0.4.2-pciutils-libz.patch, + -files/ddccontrol-0.4.2-support-fglrx.patch: + Cleanup old. Drop stable ppc keyword. 09 Mar 2014; Pawel Hajdan jr <phajdan.jr@gentoo.org> ddccontrol-0.4.2_p20140105.ebuild: diff --git a/app-misc/ddccontrol/ddccontrol-0.4.2-r1.ebuild b/app-misc/ddccontrol/ddccontrol-0.4.2-r1.ebuild deleted file mode 100644 index 11e866ecf541..000000000000 --- a/app-misc/ddccontrol/ddccontrol-0.4.2-r1.ebuild +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-misc/ddccontrol/ddccontrol-0.4.2-r1.ebuild,v 1.4 2012/08/08 22:32:18 blueness Exp $ - -EAPI="4" - -inherit eutils autotools - -DESCRIPTION="DDCControl allows control of monitor parameters via DDC" -HOMEPAGE="http://ddccontrol.sourceforge.net/" -SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 ppc x86" -IUSE="+ddcpci doc gnome gtk nls static-libs" - -RDEPEND="dev-libs/libxml2:2 - gtk? ( >=x11-libs/gtk+-2.4:2 ) - gnome? ( >=gnome-base/gnome-panel-2.10 ) - sys-apps/pciutils - nls? ( sys-devel/gettext ) - >=app-misc/ddccontrol-db-20060730" -DEPEND="${RDEPEND} - dev-perl/XML-Parser - dev-util/intltool - doc? ( >=app-text/docbook-xsl-stylesheets-1.65.1 - >=dev-libs/libxslt-1.1.6 - app-text/htmltidy ) - sys-kernel/linux-headers" - -src_prepare() { - epatch "${FILESDIR}"/${P}-pciutils-libz.patch - epatch "${FILESDIR}"/${P}-automake.patch - epatch "${FILESDIR}"/${P}-no-ddcpci.patch - sed -i '/^htmldir/d' doc/Makefile.am || die - - # ppc/ppc64 do not have inb/outb/ioperm - # they also do not have (sys|asm)/io.h - if ! use amd64 && ! use x86 ; then - local card - for card in sis intel810 ; do - sed -r -i \ - -e "/${card}.Po/d" \ - -e "s~${card}[^[:space:]]*~ ~g" \ - src/ddcpci/Makefile.{am,in} - done - sed -i \ - -e '/sis_/d' \ - -e '/i810_/d' \ - src/ddcpci/main.c - fi - - ## Save for a rainy day or future patching - eautoreconf - intltoolize --force || die "intltoolize failed" -} - -src_configure() { - econf \ - --htmldir='$(datarootdir)'/doc/${PF}/html \ - $(use_enable ddcpci) \ - $(use_enable doc) \ - $(use_enable gnome gnome-applet) \ - $(use_enable gtk gnome) \ - $(use_enable nls) \ - $(use_enable static-libs static) -} - -src_install() { - default - use static-libs || find "${ED}" -name '*.la' -delete -} diff --git a/app-misc/ddccontrol/ddccontrol-0.4.2-r2.ebuild b/app-misc/ddccontrol/ddccontrol-0.4.2-r2.ebuild deleted file mode 100644 index be02944104ba..000000000000 --- a/app-misc/ddccontrol/ddccontrol-0.4.2-r2.ebuild +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-misc/ddccontrol/ddccontrol-0.4.2-r2.ebuild,v 1.3 2014/01/03 18:56:34 mrueg Exp $ - -EAPI=5 - -inherit eutils autotools - -DESCRIPTION="DDCControl allows control of monitor parameters via DDC" -HOMEPAGE="http://ddccontrol.sourceforge.net/" -SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" -IUSE="+ddcpci doc gnome gtk nls static-libs video_cards_fglrx" - -RDEPEND=">=app-misc/ddccontrol-db-20060730 - dev-libs/libxml2:2 - sys-apps/pciutils - gtk? ( >=x11-libs/gtk+-2.4:2 ) - gnome? ( >=gnome-base/gnome-panel-2.10 ) - nls? ( sys-devel/gettext ) - video_cards_fglrx? ( x11-libs/amd-adl-sdk )" -DEPEND="${RDEPEND} - dev-perl/XML-Parser - dev-util/intltool - sys-kernel/linux-headers - doc? ( >=app-text/docbook-xsl-stylesheets-1.65.1 - >=dev-libs/libxslt-1.1.6 - app-text/htmltidy )" - -src_prepare() { - epatch "${FILESDIR}"/${P}-pciutils-libz.patch \ - "${FILESDIR}"/${P}-automake.patch \ - "${FILESDIR}"/${P}-no-ddcpci.patch \ - "${FILESDIR}"/${P}-support-fglrx.patch - sed -i 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die #467574 - - sed -i '/^htmldir/d' doc/Makefile.am || die - - sed -i '/;Application/d' src/gddccontrol/gddccontrol.desktop.in || die - - # ppc/ppc64 do not have inb/outb/ioperm - # they also do not have (sys|asm)/io.h - if ! use amd64 && ! use x86 ; then - local card - for card in sis intel810 ; do - sed -r -i \ - -e "/${card}.Po/d" \ - -e "s~${card}[^[:space:]]*~ ~g" \ - src/ddcpci/Makefile.{am,ini} || die - done - sed -i \ - -e '/sis_/d' \ - -e '/i810_/d' \ - src/ddcpci/main.c || die - fi - - ## Save for a rainy day or future patching - eautoreconf - intltoolize --force || die "intltoolize failed" -} - -src_configure() { - econf \ - --htmldir='$(datarootdir)'/doc/${PF}/html \ - $(use_enable ddcpci) \ - $(use_enable doc) \ - $(use_enable gnome gnome-applet) \ - $(use_enable gtk gnome) \ - $(use_enable nls) \ - $(use_enable static-libs static) \ - $(use_enable video_cards_fglrx amdadl) -} - -src_install() { - default - use static-libs || find "${ED}" -name '*.la' -delete -} diff --git a/app-misc/ddccontrol/ddccontrol-0.4.2_p20130703.ebuild b/app-misc/ddccontrol/ddccontrol-0.4.2_p20130703.ebuild deleted file mode 100644 index 6f9981f55c96..000000000000 --- a/app-misc/ddccontrol/ddccontrol-0.4.2_p20130703.ebuild +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright 1999-2014 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-misc/ddccontrol/ddccontrol-0.4.2_p20130703.ebuild,v 1.1 2014/01/04 04:46:54 mrueg Exp $ - -EAPI=5 - -inherit eutils autotools - -DESCRIPTION="DDCControl allows control of monitor parameters via DDC" -HOMEPAGE="http://ddccontrol.sourceforge.net/" -COMMIT_ID="5339ab459702e554592fa6cd851a2d03c38c20b8" -SRC_URI="https://github.com/ddccontrol/ddccontrol/archive/${COMMIT_ID}.tar.gz -> ${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" -IUSE="+ddcpci doc gnome gtk nls static-libs video_cards_fglrx" -S=${WORKDIR}/${PN}-${COMMIT_ID} - -RDEPEND=">=app-misc/ddccontrol-db-20060730 - dev-libs/libxml2:2 - sys-apps/pciutils - gtk? ( >=x11-libs/gtk+-2.4:2 ) - gnome? ( >=gnome-base/gnome-panel-2.10 ) - nls? ( sys-devel/gettext ) - video_cards_fglrx? ( x11-libs/amd-adl-sdk )" -DEPEND="${RDEPEND} - dev-perl/XML-Parser - dev-util/intltool - sys-kernel/linux-headers - doc? ( >=app-text/docbook-xsl-stylesheets-1.65.1 - >=dev-libs/libxslt-1.1.6 - app-text/htmltidy )" - -src_prepare() { - sed -i 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac || die #467574 - sed -i '/;Application/d' src/gddccontrol/gddccontrol.desktop.in || die - - # ppc/ppc64 do not have inb/outb/ioperm - # they also do not have (sys|asm)/io.h - if ! use amd64 && ! use x86 ; then - local card - for card in sis intel810 ; do - sed -r -i \ - -e "/${card}.Po/d" \ - -e "s~${card}[^[:space:]]*~ ~g" \ - src/ddcpci/Makefile.{am,ini} || die - done - sed -i \ - -e '/sis_/d' \ - -e '/i810_/d' \ - src/ddcpci/main.c || die - fi - - ## Save for a rainy day or future patching - touch config.rpath ABOUT-NLS - eautoreconf - intltoolize --force || die "intltoolize failed" -} - -src_configure() { - econf \ - --htmldir='$(datarootdir)'/doc/${PF}/html \ - $(use_enable ddcpci) \ - $(use_enable doc) \ - $(use_enable gnome gnome-applet) \ - $(use_enable gtk gnome) \ - $(use_enable nls) \ - $(use_enable static-libs static) \ - $(use_enable video_cards_fglrx amdadl) -} - -src_install() { - default - use static-libs || find "${ED}" -name '*.la' -delete -} diff --git a/app-misc/ddccontrol/files/ddccontrol-0.4.2-automake.patch b/app-misc/ddccontrol/files/ddccontrol-0.4.2-automake.patch deleted file mode 100644 index 005efc51c636..000000000000 --- a/app-misc/ddccontrol/files/ddccontrol-0.4.2-automake.patch +++ /dev/null @@ -1,60 +0,0 @@ -taken from upstream git - -From 1c5eaf9ca5cb03d4124d54b4178d4a2a47a724d7 Mon Sep 17 00:00:00 2001 -From: Stanislav Brabec <sbrabec@suse.cz> -Date: Sun, 10 Oct 2010 18:29:16 +0200 -Subject: [PATCH] Applied ddccontrol-libexecdir.patch - ---- - .../GNOME_ddcc-applet.server.in.in | 2 +- - src/gnome-ddcc-applet/Makefile.am | 12 +++++++----- - 2 files changed, 8 insertions(+), 6 deletions(-) - -diff --git a/src/gnome-ddcc-applet/GNOME_ddcc-applet.server.in.in b/src/gnome-ddcc-applet/GNOME_ddcc-applet.server.in.in -index f3a28ba..89a6615 100644 ---- a/src/gnome-ddcc-applet/GNOME_ddcc-applet.server.in.in -+++ b/src/gnome-ddcc-applet/GNOME_ddcc-applet.server.in.in -@@ -2,7 +2,7 @@ - - <oaf_server iid="OAFIID:GNOME_ddcc-applet_Factory" - type="exe" -- location="@PKGLIBDIR@/ddcc-applet"> -+ location="@appletdir@/ddcc-applet"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:Bonobo/GenericFactory:1.0"/> -diff --git a/src/gnome-ddcc-applet/Makefile.am b/src/gnome-ddcc-applet/Makefile.am -index d16fbd0..6218efa 100644 ---- a/src/gnome-ddcc-applet/Makefile.am -+++ b/src/gnome-ddcc-applet/Makefile.am -@@ -6,9 +6,10 @@ DDCC_LDADD = ../lib/libddccontrol.la - - EXTRA_DIST = GNOME_ddcc-applet.server.in.in GNOME_ddcc-applet.xml - --pkglib_PROGRAMS = ddcc-applet --ddcc_applet_SOURCES = ddcc-applet.c ddcc-applet.h -+applet_PROGRAMS = ddcc-applet -+appletdir = $(libexecdir) - -+ddcc_applet_SOURCES = ddcc-applet.c ddcc-applet.h - ddcc_applet_LDADD = $(GNOME_LDFLAGS) $(DDCC_LDADD) - AM_CFLAGS = $(GNOME_CFLAGS) '-DPKGDATADIR="$(pkgdatadir)"' - -@@ -18,10 +19,11 @@ serverdir = $(libdir)/bonobo/servers - server_in_files = GNOME_ddcc-applet.server.in - server_DATA = $(server_in_files:.server.in=.server) - --$(server_in_files): $(server_in_files:.server.in=.server.in.in) -- sed -e "s|\@PKGLIBDIR\@|$(pkglibdir)|" $< > $@ -+$(server_in_files): $(server_in_files:.server.in=.server.in.in) Makefile -+ $(AM_V_GEN)sed \ -+ -e "s|\@appletdir\@|$(appletdir)|" \ -+ $< > $@ - - CLEANFILES = $(server_in_files) $(server_DATA) - - @INTLTOOL_SERVER_RULE@ -- --- -1.7.4.1 - diff --git a/app-misc/ddccontrol/files/ddccontrol-0.4.2-no-ddcpci.patch b/app-misc/ddccontrol/files/ddccontrol-0.4.2-no-ddcpci.patch deleted file mode 100644 index 5ecb90f12a82..000000000000 --- a/app-misc/ddccontrol/files/ddccontrol-0.4.2-no-ddcpci.patch +++ /dev/null @@ -1,14 +0,0 @@ -fix building when ddcpci is disabled. just a hack while we sort -out the real fix upstream. - ---- a/src/gddccontrol/main.c -+++ b/src/gddccontrol/main.c -@@ -24,7 +24,7 @@ - #include <stdio.h> - #include <unistd.h> - --#include "ddcpci-ipc.h" -+#define IDLE_TIMEOUT 60 - - #include "notebook.h" - diff --git a/app-misc/ddccontrol/files/ddccontrol-0.4.2-pciutils-libz.patch b/app-misc/ddccontrol/files/ddccontrol-0.4.2-pciutils-libz.patch deleted file mode 100644 index 8fb602000335..000000000000 --- a/app-misc/ddccontrol/files/ddccontrol-0.4.2-pciutils-libz.patch +++ /dev/null @@ -1,19 +0,0 @@ -Index: configure.ac -=================================================================== -RCS file: /cvsroot/ddccontrol/ddccontrol/configure.ac,v -retrieving revision 1.40 -diff -u -r1.40 configure.ac ---- configure.ac 26 Jul 2006 22:02:15 -0000 1.40 -+++ configure.ac 1 Mar 2007 14:49:35 -0000 -@@ -101,7 +101,10 @@ - DDCPCI= - if test x$support_ddcpci = xyes; then - AC_CHECK_HEADERS([pci/pci.h], [], [AC_MSG_ERROR([PCI utils headers not found, please install pci-utils.], [1])], []) -- AC_CHECK_LIB([pci], [pci_alloc], [], [AC_MSG_ERROR([PCI utils library not found, please install pci-utils.], [1])]) -+ AC_CHECK_LIB([pci], [pci_alloc], [], [ -+ AC_CHECK_LIB([z], [gzopen], [], [AC_MSG_ERROR([PCI utils library not found, please install pci-utils.], [1])]) -+ AC_CHECK_LIB([pci], [pci_fill_info], [], [AC_MSG_ERROR([PCI utils library not found, please install pci-utils.], [1])], [-lz]) -+ ]) - DDCPCI=ddcpci - AC_DEFINE_UNQUOTED(HAVE_DDCPCI, 1, [Define if ddccontrol is built with ddcpci support.]) - fi diff --git a/app-misc/ddccontrol/files/ddccontrol-0.4.2-support-fglrx.patch b/app-misc/ddccontrol/files/ddccontrol-0.4.2-support-fglrx.patch deleted file mode 100644 index 565d1928fdd7..000000000000 --- a/app-misc/ddccontrol/files/ddccontrol-0.4.2-support-fglrx.patch +++ /dev/null @@ -1,606 +0,0 @@ -Source: http://sourceforge.net/mailarchive/message.php?msg_id=30201548 -Author: Vitaly V. BUrsov (vitaly@bursov.com) -Date: 2013-01-16 - -diff --git a/src/lib/amd_adl.c b/src/lib/amd_adl.c -new file mode 100644 -index 0000000..40ca909 ---- /dev/null -+++ b/src/lib/amd_adl.c -@@ -0,0 +1,306 @@ -+/* -+ ddc/ci interface functions header -+ Copyright(c) 2012 Vitaly V. Bursov (vitaly@bursov.com) -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+*/ -+ -+#include "config.h" -+ -+#ifdef HAVE_AMDADL -+#include <errno.h> -+#include <stdlib.h> -+#include <stdio.h> -+#include <fcntl.h> -+#include <string.h> -+#include <unistd.h> -+#include <sys/types.h> -+#include <sys/stat.h> -+#include <stdint.h> -+#include <dlfcn.h> -+ -+#define MAX_DISPLAYS (64) -+ -+#ifndef LINUX -+#define LINUX /* not Windows */ -+#endif -+#include <ADL/adl_sdk.h> -+ -+#include "amd_adl.h" -+#include "ddcci.h" -+ -+#if 1 -+# define D(x) -+#else -+# define D(x) x -+#endif -+ -+struct adl_state { -+ int initialized; -+ -+ void *lib; -+ -+ int (*ADL_Main_Control_Create)(ADL_MAIN_MALLOC_CALLBACK, int ); -+ int (*ADL_Main_Control_Destroy)(); -+ -+ int (*ADL_Adapter_NumberOfAdapters_Get)(int *lpNumAdapters); -+ int (*ADL_Adapter_AdapterInfo_Get)(LPAdapterInfo lpInfo, int iInputSize); -+ int (*ADL_Display_NumberOfDisplays_Get)(int iAdapterIndex, int *lpNumDisplays); -+ int (*ADL_Display_DisplayInfo_Get)(int iAdapterIndex, int *lpNumDisplays, ADLDisplayInfo **lppInfo, int iForceDetect); -+ int (*ADL_Display_DDCBlockAccess_Get)(int iAdapterIndex, int iDisplayIndex, int iOption, int iCommandIndex, int iSendMsgLen, char *lpucSendMsgBuf, int *lpulRecvMsgLen, char *lpucRecvMsgBuf); -+ -+ struct _displays { -+ int adapter_index; -+ int display_index; -+ } displays[MAX_DISPLAYS]; -+ int displays_count; -+}; -+ -+static struct adl_state *adl; -+ -+static void* __stdcall adl_malloc (int size) -+{ -+ void* buffer = malloc (size); -+ if (buffer) -+ memset(buffer, 0, size); -+ return buffer; -+} -+ -+static void __stdcall adl_free ( void **buffer ) -+{ -+ if (*buffer != NULL) { -+ free (*buffer); -+ *buffer = NULL; -+ } -+} -+ -+int amd_adl_get_displays_count() -+{ -+ if (!adl->initialized) -+ return -1; -+ -+ return adl->displays_count; -+} -+ -+int amd_adl_get_display(int idx, int *adapter, int *display) -+{ -+ if (!adl->initialized) -+ return -1; -+ -+ if (idx < 0 || idx >= adl->displays_count) -+ return -1; -+ -+ if (adapter) -+ *adapter = adl->displays[idx].adapter_index; -+ if (display) -+ *display = adl->displays[idx].display_index; -+ -+ return 0; -+} -+ -+int amd_adl_check_display(int adapter, int display) -+{ -+ int i; -+ -+ if (!adl->initialized) -+ return -1; -+ -+ for (i=0;i<adl->displays_count;i++){ -+ if (adl->displays[i].adapter_index == adapter && -+ adl->displays[i].display_index == display) -+ return 0; -+ } -+ return -1; -+} -+ -+int amd_adl_i2c_read(int adapter, int display, unsigned int addr, unsigned char *buf, unsigned int len) -+{ -+ int res; -+ char wbuf = addr << 1 | 1; -+ -+ res = adl->ADL_Display_DDCBlockAccess_Get(adapter, display, 0, 0, 1, &wbuf, (int*)&len, (char*)buf); -+ -+ D(fprintf(stderr, " >>>>>>>> adl i2c r on %d:%d a %x l %d err %d\n", adapter, display, addr, len, res)); -+ -+ if (res != ADL_OK){ -+ return -1; -+ } -+ -+ return len; -+} -+ -+int amd_adl_i2c_write(int adapter, int display, unsigned int addr, unsigned char *buf, unsigned int len) -+{ -+ int res, rlen; -+ char *wbuf = alloca(len+1); -+ -+ wbuf[0] = addr << 1; -+ memcpy(&wbuf[1], buf, len); -+ -+ rlen = 0; -+ res = adl->ADL_Display_DDCBlockAccess_Get(adapter, display, 0, 0, len+1, wbuf, &rlen, NULL); -+ -+ D(fprintf(stderr, " >>>>>>>> adl i2c w on %d:%d a %x l %d err %d\n", adapter, display, addr, len, res)); -+ -+ if (res != ADL_OK){ -+ return -1; -+ } -+ -+ return len; -+} -+ -+ -+int amd_adl_init() -+{ -+ int i; -+ int res; -+ int adapters_count; -+ AdapterInfo *adapter_info; -+ -+ adl = adl_malloc(sizeof(struct adl_state)); -+ -+ if (!adl){ -+ fprintf(stderr, "ADL error: malloc failed\n"); -+ return 0; -+ } -+ -+ adl->lib = dlopen("libatiadlxx.so", RTLD_LAZY|RTLD_GLOBAL); -+ if (!adl->lib){ -+ if (get_verbosity()) -+ perror("ADL error: dlopen() failed\n"); -+ return 0; -+ } -+#define LOADFUNC(_n_) \ -+ do { \ -+ adl->_n_ = dlsym(adl->lib, #_n_); \ -+ if (!adl->_n_) { \ -+ fprintf(stderr, "ADL error: loading symbol %s\n", #_n_); \ -+ return 0; \ -+ } \ -+ } while (0) -+ -+ LOADFUNC(ADL_Main_Control_Create); -+ LOADFUNC(ADL_Main_Control_Destroy); -+ -+ LOADFUNC(ADL_Adapter_NumberOfAdapters_Get); -+ LOADFUNC(ADL_Adapter_AdapterInfo_Get); -+ LOADFUNC(ADL_Display_NumberOfDisplays_Get); -+ LOADFUNC(ADL_Display_DisplayInfo_Get); -+ LOADFUNC(ADL_Display_DDCBlockAccess_Get); -+ -+#undef LOADFUNC -+ -+ res = adl->ADL_Main_Control_Create(adl_malloc, 1); // retrieve adapter information only for adapters that are physically present and enabled -+ -+ if (res != ADL_OK){ -+ if (get_verbosity()) -+ fprintf(stderr, "Failed to initialize ADL: %d\n", res); -+ return 0; -+ } -+ -+ res = adl->ADL_Adapter_NumberOfAdapters_Get(&adapters_count); -+ if (res != ADL_OK){ -+ if (get_verbosity()) -+ fprintf(stderr, "Failed to get number of ADL adapters: %d\n", res); -+ return 0; -+ } -+ -+ if (adapters_count < 1){ -+ if (get_verbosity()) -+ fprintf(stderr, "No ADL adapters found.\n"); -+ return 0; -+ } -+ -+ adapter_info = adl_malloc(sizeof(AdapterInfo) * adapters_count); -+ if (!adapter_info){ -+ fprintf(stderr, "ADL error: malloc failed\n"); -+ return 0; -+ } -+ -+ res = adl->ADL_Adapter_AdapterInfo_Get(adapter_info, sizeof(AdapterInfo) * adapters_count); -+ if (res != ADL_OK){ -+ fprintf(stderr, "Failed to get ADL adapters info: %d\n", res); -+ return 0; -+ } -+ -+ for (i=0;i<adapters_count;i++){ -+ int aidx = adapter_info[i].iAdapterIndex; -+ int numdisplays; -+ int j; -+ ADLDisplayInfo *display_info; -+ -+ if (adl->ADL_Display_DisplayInfo_Get(aidx, &numdisplays, &display_info, 0) != ADL_OK) -+ continue; -+ -+ D(printf("\t ================================\n")); -+ D(printf("\t %d: %s - %s %d %x:%x.%x %s\n", adapter_info[i].iAdapterIndex, adapter_info[i].strAdapterName, adapter_info[i].strDisplayName, -+ adapter_info[i].iPresent, -+ adapter_info[i].iBusNumber, -+ adapter_info[i].iDeviceNumber, -+ adapter_info[i].iFunctionNumber, -+ adapter_info[i].strUDID)); -+ -+ for (j=0;j<numdisplays;j++){ -+ int didx; -+ -+ if ((display_info[j].iDisplayInfoValue & ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED) && -+ (display_info[j].iDisplayInfoValue & ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED)){ -+ -+ didx = display_info[j].displayID.iDisplayLogicalIndex; -+ -+ D(printf("\t\t found display %s at %d:%d\n", -+ display_info[j].strDisplayName, aidx, didx)); -+ -+ adl->displays[adl->displays_count].adapter_index = aidx; -+ adl->displays[adl->displays_count].display_index = didx; -+ adl->displays_count++; -+ if (adl->displays_count >= MAX_DISPLAYS){ -+ break; -+ } -+ } -+ } -+ -+ adl_free((void**)&display_info); -+ -+ if (adl->displays_count >= MAX_DISPLAYS){ -+ break; -+ } -+ } -+ -+ adl_free((void**)&adapter_info); -+ -+ D(fprintf(stderr, "adl initialized, %d displays\n", adl->displays_count)); -+ -+ adl->initialized = 1; -+ return 1; -+} -+ -+void amd_adl_free() -+{ -+ if (!adl) -+ return; -+ -+ adl->ADL_Main_Control_Destroy(); -+ -+ if (adl->lib){ -+ dlclose(adl->lib); -+ adl->lib = NULL; -+ } -+ -+ adl_free((void**)&adl); -+} -+ -+#endif /* HAVE_AMDADL */ -+ -diff --git a/src/lib/amd_adl.h b/src/lib/amd_adl.h -new file mode 100644 -index 0000000..d6c7bc1 ---- /dev/null -+++ b/src/lib/amd_adl.h -@@ -0,0 +1,33 @@ -+/* -+ ddc/ci interface functions header -+ Copyright(c) 2012 Vitaly V. Bursov (vitaly@bursov.com) -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+*/ -+ -+#ifndef AMD_ADL_H -+#define AMD_ADL_H -+ -+int amd_adl_init(); -+void amd_adl_free(); -+ -+int amd_adl_get_displays_count(); -+int amd_adl_get_display(int idx, int *adapter, int *display); -+int amd_adl_check_display(int adapter, int display); -+ -+int amd_adl_i2c_read(int adapter, int display, unsigned int addr, unsigned char *buf, unsigned int len); -+int amd_adl_i2c_write(int adapter, int display, unsigned int addr, unsigned char *buf, unsigned int len); -+ -+#endif /* AMD_ADL_H */ -diff --git a/src/lib/ddcci.c b/src/lib/ddcci.c -index 4492df5..186d597 100644 ---- a/src/lib/ddcci.c -+++ b/src/lib/ddcci.c -@@ -38,6 +38,7 @@ - #include <sys/stat.h> - - #include "ddcci.h" -+#include "amd_adl.h" - - #include "conf.h" - -@@ -239,12 +240,22 @@ int ddcci_init(char* usedatadir) - printf(_("Failed to initialize ddccontrol database...\n")); - return 0; - } -+#ifdef HAVE_AMDADL -+ if (!amd_adl_init()){ -+ if (verbosity) { -+ printf(_("Failed to initialize ADL...\n")); -+ } -+ } -+#endif - return ddcpci_init(); - } - - void ddcci_release() { - ddcpci_release(); - ddcci_release_db(); -+#ifdef HAVE_AMDADL -+ amd_adl_free(); -+#endif - } - - /* write len bytes (stored in buf) to i2c address addr */ -@@ -318,6 +329,12 @@ static int i2c_write(struct monitor* mon, unsigned int addr, unsigned char *buf, - return adata.status; - } - #endif -+#ifdef HAVE_AMDADL -+ case type_adl: -+ { -+ return amd_adl_i2c_write(mon->adl_adapter, mon->adl_display, addr, buf, len); -+ } -+#endif - default: - return -1; - } -@@ -396,6 +413,12 @@ static int i2c_read(struct monitor* mon, unsigned int addr, unsigned char *buf, - return ret - ANSWER_SIZE; - } - #endif -+#ifdef HAVE_AMDADL -+ case type_adl: -+ { -+ return amd_adl_i2c_read(mon->adl_adapter, mon->adl_display, addr, buf, len); -+ } -+#endif - default: - return -1; - } -@@ -929,6 +952,23 @@ static int ddcci_open_with_addr(struct monitor* mon, const char* filename, int a - mon->type = pci; - } - #endif -+#ifdef HAVE_AMDADL -+ else if (strncmp(filename, "adl:", 4) == 0) { -+ mon->adl_adapter = -1; -+ mon->adl_display = -1; -+ if (sscanf(filename, "adl:%d:%d", &mon->adl_adapter, &mon->adl_display) != 2){ -+ fprintf(stderr, _("Invalid filename (%s).\n"), filename); -+ return -3; -+ } -+ -+ if (amd_adl_check_display(mon->adl_adapter, mon->adl_display)){ -+ fprintf(stderr, _("ADL display not found (%s).\n"), filename); -+ return -3; -+ } -+ -+ mon->type = type_adl; -+ } -+#endif - else { - fprintf(stderr, _("Invalid filename (%s).\n"), filename); - return -3; -@@ -1167,6 +1207,28 @@ struct monitorlist* ddcci_probe() { - - closedir(dirp); - -+#ifdef HAVE_AMDADL -+ /* ADL probe */ -+ int adl_disp; -+ -+ for (adl_disp=0; adl_disp<amd_adl_get_displays_count(); adl_disp++){ -+ int adapter, display; -+ if (amd_adl_get_display(adl_disp, &adapter, &display)) -+ break; -+ -+ filename = malloc(64); -+ snprintf(filename, 64, "adl:%d:%d", adapter, display); -+ if (verbosity) { -+ printf(_("Found ADL display (%s)\n"), filename); -+ } -+ ddcci_probe_device(filename, ¤t, &last); -+ if (!verbosity) { -+ printf("."); -+ fflush(stdout); -+ } -+ } -+#endif -+ - if (!verbosity) - printf("\n"); - -diff --git a/src/lib/ddcci.h b/src/lib/ddcci.h -index c058051..cac907b 100644 ---- a/src/lib/ddcci.h -+++ b/src/lib/ddcci.h -@@ -63,6 +63,9 @@ struct caps { - struct monitor { - int fd; - unsigned int addr; -+#ifdef HAVE_AMDADL -+ int adl_adapter, adl_display; -+#endif - char pnpid[8]; - unsigned char digital; /* 0 - digital, 1 - analog */ - struct timeval last; -@@ -76,6 +79,9 @@ struct monitor { - #ifdef HAVE_DDCPCI - ,pci - #endif -+#ifdef HAVE_AMDADL -+ ,type_adl -+#endif - } type; - int probing; /* are we probing? */ - diff --git a/configure.ac b/configure.ac -index 8ee47f3..79e831e 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -112,6 +112,39 @@ fi - - AC_SUBST([DDCPCI]) - -+# AMD ADL support check -+support_amdadl= -+AC_ARG_ENABLE(amdadl, -+ [ --enable-amdadl enable AMD Display Library support (autodetect) ], -+ [if test x$enableval = xno; then -+ support_amdadl=no -+ else -+ support_amdadl=yes -+ fi]) -+ -+AMDADL= -+if test x$support_amdadl = xyes; then -+ AC_CHECK_HEADERS([ADL/adl_sdk.h], [], [AC_MSG_ERROR([ADL headers not found, but ADL support requested.], [1])], -+ [#ifndef __stdcall -+ #define __stdcall -+ #endif -+ ]) -+ AMDADL=amdadl -+elif test x$support_amdadl = x; then -+ AC_CHECK_HEADERS([ADL/adl_sdk.h], [ -+ AMDADL=amdadl -+ ], [], [#ifndef __stdcall -+ #define __stdcall -+ #endif -+ ]) -+fi -+ -+if test x$AMDADL = xamdadl; then -+ AC_DEFINE_UNQUOTED(HAVE_AMDADL, 1, [Define if ddccontrol is built with ADL support.]) -+fi -+ -+AC_SUBST([AMDADL]) -+ - # Gnome check - support_gnome=yes - AC_ARG_ENABLE(gnome, -diff --git a/src/config.h.in b/src/config.h.in -index 971ec71..e0f31c6 100644 ---- a/src/config.h.in -+++ b/src/config.h.in -@@ -4,6 +4,12 @@ - language is requested. */ - #undef ENABLE_NLS - -+/* Define to 1 if you have the <ADL/adl_sdk.h> header file. */ -+#undef HAVE_ADL_ADL_SDK_H -+ -+/* Define if ddccontrol is built with ADL support. */ -+#undef HAVE_AMDADL -+ - /* Define if linux/i2c-dev.h is buggy on your system, so defaults constants - and structures must be used */ - #undef HAVE_BUGGY_I2C_DEV -@@ -41,7 +47,7 @@ - /* Define if ddccontrol is built with /dev/i2c-* support. */ - #undef HAVE_I2C_DEV - --/* Define if you have the iconv() function. */ -+/* Define if you have the iconv() function and it works. */ - #undef HAVE_ICONV - - /* Define to 1 if you have the <inttypes.h> header file. */ -@@ -50,6 +56,9 @@ - /* Define to 1 if you have the `pci' library (-lpci). */ - #undef HAVE_LIBPCI - -+/* Define to 1 if you have the `z' library (-lz). */ -+#undef HAVE_LIBZ -+ - /* Define to 1 if you have the <linux/types.h> header file. */ - #undef HAVE_LINUX_TYPES_H - -@@ -89,6 +98,10 @@ - /* Define to 1 if you have the <unistd.h> header file. */ - #undef HAVE_UNISTD_H - -+/* Define to the sub-directory in which libtool stores uninstalled libraries. -+ */ -+#undef LT_OBJDIR -+ - /* Name of package */ - #undef PACKAGE - -@@ -104,6 +117,9 @@ - /* Define to the one symbol short name of this package. */ - #undef PACKAGE_TARNAME - -+/* Define to the home page for this package. */ -+#undef PACKAGE_URL -+ - /* Define to the version of this package. */ - #undef PACKAGE_VERSION - -diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am -index ce18dcf..775629e 100644 ---- a/src/lib/Makefile.am -+++ b/src/lib/Makefile.am -@@ -11,6 +11,7 @@ $(pkgconfig_DATA): $(srcdir)/ddccontrol.pc.in $(top_builddir)/config.status - lib_LTLIBRARIES = libddccontrol.la - - libddccontrol_la_SOURCES = ddcci.c ddcci.h monitor_db.c monitor_db.h \ -- ddcpci-ipc.h i2c-dev.h conf.c conf.h -+ ddcpci-ipc.h i2c-dev.h conf.c conf.h amd_adl.c amd_adl.h -+ - libddccontrol_la_LIBADD = $(LIBXML2_LDFLAGS) - AM_CFLAGS = $(LIBXML2_CFLAGS) |