debian/0000775000000000000000000000000012054022752007167 5ustar debian/copyright0000664000000000000000000000311712015463213011122 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Contact: Rob Clark Source: https://github.com/robclark/libdri2.git Files: * Copyright: 2005-2008, Red Hat, Inc. License: Expat Files: src/list.h Copyright: 2010, Intel Corporation 2010, Francisco Jerez License: Expat Files: test/* Copyright: 2011, Texas Instruments, Inc License: Expat Files: debian/* Copyright: 2012, Linaro Limited 2012, Texas Instruments, Inc License: Expat License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/libdri2-1.symbols0000664000000000000000000000136312015463213012267 0ustar libdri2.so.1 libdri2-1 #MINVER# DRI2Authenticate@Base 1.0.0~git20120510+26fee2e DRI2Connect@Base 1.0.0~git20120510+26fee2e DRI2CopyRegion@Base 1.0.0~git20120510+26fee2e DRI2CreateDrawable@Base 1.0.0~git20120510+26fee2e DRI2DestroyDrawable@Base 1.0.0~git20120510+26fee2e DRI2GetBuffers@Base 1.0.0~git20120510+26fee2e DRI2GetBuffersWithFormat@Base 1.0.0~git20120510+26fee2e DRI2GetMSC@Base 1.0.0~git20120510+26fee2e DRI2InitDisplay@Base 1.0.0~git20120510+26fee2e DRI2QueryExtension@Base 1.0.0~git20120510+26fee2e DRI2QueryVersion@Base 1.0.0~git20120510+26fee2e DRI2SwapBuffers@Base 1.0.0~git20120510+26fee2e DRI2SwapInterval@Base 1.0.0~git20120510+26fee2e DRI2WaitMSC@Base 1.0.0~git20120510+26fee2e DRI2WaitSBC@Base 1.0.0~git20120510+26fee2e debian/changelog0000664000000000000000000000172412054022731011042 0ustar libdri2 (1.0.0~git20120510+26fee2e-0ubuntu2) raring; urgency=low * Enable dri2-utils package on armhf only. The test utility is incompatible with the new libdrm_nouveau API, hence currently can only be built on armhf with libdrm_omap. -- Dmitrijs Ledkovs Sat, 24 Nov 2012 01:36:44 +0000 libdri2 (1.0.0~git20120510+26fee2e-0ubuntu1) quantal; urgency=low * Initial release (LP: #1040611) * debian/patches/force-dependency-nouveau1.patch: - Force dependency with the older libdrm_nouveau1 lib * debian/patches/moving-libdri2test-to-static.patch: - Avoid installing libdrm2_test as a shared library, as it's needed only by dri2test * debian/patches/names-pitches-array-multiplanar-yuv.patch - Change DRI2Buffer to make names/pitches into an array to deal with multiplanar yuv (needed by the PVR SGX OMAP4 driver). -- Ricardo Salveti de Araujo Thu, 23 Aug 2012 04:43:40 -0300 debian/source/0000775000000000000000000000000012015463213010465 5ustar debian/source/format0000664000000000000000000000001412015463213011673 0ustar 3.0 (quilt) debian/patches/0000775000000000000000000000000012015463213010614 5ustar debian/patches/series0000664000000000000000000000015512015463213012032 0ustar force-dependency-nouveau1.patch moving-libdri2test-to-static.patch names-pitches-array-multiplanar-yuv.patch debian/patches/force-dependency-nouveau1.patch0000664000000000000000000000147412015463213016616 0ustar Description: Force nouveau library to libdrm_nouveau1 That's needed since the libdrm_nouveu lib is not compatible anymore with the older one. Forwarded: not-needed Author: Ricardo Salveti diff --git a/configure.ac b/configure.ac index e80c08e..3e7990a 100644 --- a/configure.ac +++ b/configure.ac @@ -55,7 +55,7 @@ if test "x$TEST" = xyes; then # Check for individual driver implementations... not required for # libdri2, but is required for the test app to map the buffer.. - PKG_CHECK_MODULES(NOUVEAU, libdrm_nouveau, [HAVE_NOUVEAU=yes], [HAVE_NOUVEAU=no]) + PKG_CHECK_MODULES(NOUVEAU, libdrm_nouveau1, [HAVE_NOUVEAU=yes], [HAVE_NOUVEAU=no]) if test "x$HAVE_NOUVEAU" = "xyes"; then have_drm_driver=yes AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support]) debian/patches/names-pitches-array-multiplanar-yuv.patch0000664000000000000000000001626512015463213020672 0ustar Description: Change DRI2Buffer to enable multiplanar yuv Change DRI2Buffer to make names/pitches into an array to deal with multiplanar yuv (needed for the PVR SGX OMAP4 driver). Forwarded: not-needed Author: Rob Clark diff --git a/include/X11/extensions/dri2.h b/include/X11/extensions/dri2.h index e42cdb6..71c7334 100644 --- a/include/X11/extensions/dri2.h +++ b/include/X11/extensions/dri2.h @@ -43,8 +43,8 @@ typedef struct { unsigned int attachment; - unsigned int name; - unsigned int pitch; + unsigned int names[3]; /* unused entries set to zero.. non-planar formats only use names[0] */ + unsigned int pitch[3]; /* unused entries set to zero.. non-planar formats only use pitch[0] */ unsigned int cpp; unsigned int flags; } DRI2Buffer; diff --git a/src/dri2.c b/src/dri2.c index 1154a9e..f94736c 100644 --- a/src/dri2.c +++ b/src/dri2.c @@ -363,10 +363,9 @@ DRI2DestroyDrawable(Display * dpy, XID drawable) SyncHandle(); } -DRI2Buffer * -DRI2GetBuffers(Display * dpy, XID drawable, - int *width, int *height, - unsigned int *attachments, int count, int *outCount) +static DRI2Buffer * +getbuffers(Display *dpy, XID drawable, int *width, int *height, + unsigned int *attachments, int count, int *outCount, int dri2ReqType) { XExtDisplayInfo *info = DRI2FindDisplay(dpy); xDRI2GetBuffersReply rep; @@ -374,18 +373,27 @@ DRI2GetBuffers(Display * dpy, XID drawable, DRI2Buffer *buffers; xDRI2Buffer repBuffer; CARD32 *p; - int i; + int i, nattachments; + + /* DRI2GetBuffersWithFormat has interleaved attachment+format in + * attachments[] array, so length of array is 2x as long.. + */ + if (dri2ReqType == X_DRI2GetBuffersWithFormat) { + nattachments = 2 * count; + } else { + nattachments = count; + } XextCheckExtension(dpy, info, dri2ExtensionName, False); LockDisplay(dpy); - GetReqExtra(DRI2GetBuffers, count * 4, req); + GetReqExtra(DRI2GetBuffers, nattachments * 4, req); req->reqType = info->codes->major_opcode; - req->dri2ReqType = X_DRI2GetBuffers; + req->dri2ReqType = dri2ReqType; req->drawable = drawable; req->count = count; p = (CARD32 *) & req[1]; - for (i = 0; i < count; i++) + for (i = 0; i < nattachments; i++) p[i] = attachments[i]; if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { @@ -398,21 +406,16 @@ DRI2GetBuffers(Display * dpy, XID drawable, *height = rep.height; *outCount = rep.count; - buffers = Xmalloc(rep.count * sizeof buffers[0]); - if (buffers == NULL) { - _XEatData(dpy, rep.count * sizeof repBuffer); - UnlockDisplay(dpy); - SyncHandle(); - return NULL; - } - + buffers = calloc(rep.count, sizeof buffers[0]); for (i = 0; i < rep.count; i++) { _XReadPad(dpy, (char *) &repBuffer, sizeof repBuffer); - buffers[i].attachment = repBuffer.attachment; - buffers[i].name = repBuffer.name; - buffers[i].pitch = repBuffer.pitch; - buffers[i].cpp = repBuffer.cpp; - buffers[i].flags = repBuffer.flags; + if (buffers) { + buffers[i].attachment = repBuffer.attachment; + buffers[i].names[0] = repBuffer.name; + buffers[i].pitch[0] = repBuffer.pitch; + buffers[i].cpp = repBuffer.cpp; + buffers[i].flags = repBuffer.flags; + } } UnlockDisplay(dpy); @@ -421,63 +424,22 @@ DRI2GetBuffers(Display * dpy, XID drawable, return buffers; } +DRI2Buffer * +DRI2GetBuffers(Display * dpy, XID drawable, + int *width, int *height, + unsigned int *attachments, int count, int *outCount) +{ + return getbuffers(dpy, drawable, width, height, attachments, + count, outCount, X_DRI2GetBuffers); +} DRI2Buffer * DRI2GetBuffersWithFormat(Display * dpy, XID drawable, int *width, int *height, unsigned int *attachments, int count, int *outCount) { - XExtDisplayInfo *info = DRI2FindDisplay(dpy); - xDRI2GetBuffersReply rep; - xDRI2GetBuffersReq *req; - DRI2Buffer *buffers; - xDRI2Buffer repBuffer; - CARD32 *p; - int i; - - XextCheckExtension(dpy, info, dri2ExtensionName, False); - - LockDisplay(dpy); - GetReqExtra(DRI2GetBuffers, count * (4 * 2), req); - req->reqType = info->codes->major_opcode; - req->dri2ReqType = X_DRI2GetBuffersWithFormat; - req->drawable = drawable; - req->count = count; - p = (CARD32 *) & req[1]; - for (i = 0; i < (count * 2); i++) - p[i] = attachments[i]; - - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { - UnlockDisplay(dpy); - SyncHandle(); - return NULL; - } - - *width = rep.width; - *height = rep.height; - *outCount = rep.count; - - buffers = Xmalloc(rep.count * sizeof buffers[0]); - if (buffers == NULL) { - _XEatData(dpy, rep.count * sizeof repBuffer); - UnlockDisplay(dpy); - SyncHandle(); - return NULL; - } - - for (i = 0; i < rep.count; i++) { - _XReadPad(dpy, (char *) &repBuffer, sizeof repBuffer); - buffers[i].attachment = repBuffer.attachment; - buffers[i].name = repBuffer.name; - buffers[i].pitch = repBuffer.pitch; - buffers[i].cpp = repBuffer.cpp; - buffers[i].flags = repBuffer.flags; - } - - UnlockDisplay(dpy); - SyncHandle(); - - return buffers; + return getbuffers(dpy, drawable, width, height, attachments, + count, outCount, X_DRI2GetBuffersWithFormat); } diff --git a/test/dri2-nouveau.c b/test/dri2-nouveau.c index f91cc48..52de35e 100644 --- a/test/dri2-nouveau.c +++ b/test/dri2-nouveau.c @@ -52,7 +52,7 @@ static void setup(int fd) static void * init(DRI2Buffer *dri2buf) { struct nouveau_bo *bo = NULL; - int ret = nouveau_bo_handle_ref(dev, dri2buf->name, &bo); + int ret = nouveau_bo_handle_ref(dev, dri2buf->names[0], &bo); if (ret) { ERROR_MSG("nouveau_bo_handle_ref failed: %d", ret); return NULL; diff --git a/test/dri2-omap.c b/test/dri2-omap.c index 181599d..2bcff28 100644 --- a/test/dri2-omap.c +++ b/test/dri2-omap.c @@ -48,7 +48,7 @@ static void setup(int fd) static void * init(DRI2Buffer *dri2buf) { - return omap_bo_from_name(dev, dri2buf->name); + return omap_bo_from_name(dev, dri2buf->names[0]); } static char * prep(void *hdl) diff --git a/test/dri2test.c b/test/dri2test.c index 1aa101d..ec74e81 100644 --- a/test/dri2test.c +++ b/test/dri2test.c @@ -48,7 +48,7 @@ static void fill(char *virtual, int n, int width, int height, int stride) for (j = 0; j < height; j++) { uint32_t *fb_ptr = (uint32_t*)((char*)virtual + j * stride); for (i = 0; i < width; i++) { - div_t d = div(n+i, width); + div_t d = div(n+i+j, width); fb_ptr[i] = 0x00130502 * (d.quot >> 6) + 0x000a1120 * (d.rem >> 6); @@ -109,7 +109,7 @@ int main(int argc, char **argv) CARD64 count; char *buf = backend->prep(bufs[i % nbufs].hdl); - fill(buf, i, w, h, bufs[i % nbufs].dri2buf->pitch); + fill(buf, i, w, h, bufs[i % nbufs].dri2buf->pitch[0]); backend->fini(bufs[i % nbufs].hdl); DRI2SwapBuffers(dpy, win, 0, 0, 0, &count); MSG("DRI2SwapBuffers: count=%lu", count); debian/patches/moving-libdri2test-to-static.patch0000664000000000000000000000104212015463213017263 0ustar Description: Avoid installing libdri2test as a shared library This library is just used by the dri2test case, and doesn't need to be linked as a shared library nor needs to be installed at the system. Forwarded: yes Author: Ricardo Salveti diff --git a/test/Makefile.am b/test/Makefile.am index 8515c6b..bfafadd 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,4 +1,4 @@ -lib_LTLIBRARIES = libdri2test.la +noinst_LTLIBRARIES = libdri2test.la COMMON_SOURCES = dri2util.c COMMON_LIBADD = @DRI2_LIBS@ debian/dri2-utils.manpages0000664000000000000000000000002212015463213012672 0ustar debian/dri2test.1 debian/dri2-utils.install0000664000000000000000000000001212015463213012544 0ustar usr/bin/* debian/compat0000664000000000000000000000000212015463213010363 0ustar 9 debian/libdri2-dev.install0000664000000000000000000000010712015463213012656 0ustar usr/include/* usr/lib/*/lib*.a usr/lib/*/lib*.so usr/lib/*/pkgconfig/* debian/dri2test.10000664000000000000000000000214712015463213011013 0ustar .TH DRI2TEST 1 "August 23, 2012" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME dri2test \- simple program to test the dri2 support .SH SYNOPSIS .B dri2test .SH DESCRIPTION .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBdri2test\fP is a simple program to test the dri2 support by creating a X11 window, connecting to the dri2 interface, and calling a set of basic functions to validate the dri2 support at the system. .SH AUTHOR dri2test was written by Rob Clark . .PP This manual page was written by Ricardo Salveti de Araujo , for the Debian project (and may be used by others). debian/libdri2-1.install0000664000000000000000000000002712015463213012241 0ustar usr/lib/*/libdri2.so.* debian/control0000664000000000000000000000316712054022745010603 0ustar Source: libdri2 Section: libs Priority: optional Maintainer: Ubuntu Developers Build-Depends: debhelper (>= 9), quilt, dh-autoreconf, libdrm-dev (>= 2.4.32), libxext-dev, pkg-config, x11proto-xext-dev, x11proto-dri2-dev, libxfixes-dev, xutils-dev Standards-Version: 3.9.3 Package: libdri2-dev Section: libdevel Architecture: any Depends: ${misc:Depends}, libdri2-1 (= ${binary:Version}) Description: library for the DRI2 extension to the X Window System -- development files This package provides the development environment for libdri2. Package: libdri2-1 Section: libs Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} Description: library for the DRI2 extension to the X Window System -- runtime This package provides the runtime environment for libdri2. Package: libdri2-dbg Section: debug Priority: extra Architecture: any Multi-Arch: same Depends: ${misc:Depends}, libdri2-1 (= ${binary:Version}) Description: library for the DRI2 extension to the X Window System -- debugging symbols This package provides the debugging symbols for the libdri2 package. Package: dri2-utils Section: misc Priority: extra Architecture: armhf Depends: ${misc:Depends}, ${shlibs:Depends}, libdri2-1 (= ${binary:Version}) Description: Tests utilities for the DRI2 extension to the X Window System -- testing tools This package provides the testing tools for the libdri2 package. debian/rules0000775000000000000000000000216312015463213010247 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 deb_source := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p') deb_version := $(shell dpkg-parsechangelog | sed -n 's/^Version: //p') upstream_version := $(shell echo '$(deb_version)' | sed 's/.*://; s/-[^-]*$$//') git_rev := $(shell echo '$(upstream_version)' | sed 's/.*+//') get-orig-source: rm -rf $(deb_source)-$(upstream_version) rm -f $(deb_source)-$(upstream_version).orig.tar.gz git clone https://github.com/robclark/libdri2.git $(deb_source)-$(upstream_version) cd $(deb_source)-$(upstream_version) && git archive \ --format=tar \ --prefix=$(deb_source)-$(upstream_version)/ \ $(git_rev) \ | gzip >../$(deb_source)_$(upstream_version).orig.tar.gz rm -rf $(deb_source)-$(upstream_version) override_dh_auto_configure: dh_auto_configure -- --enable-test override_dh_auto_install: dh_auto_install --destdir=debian/tmp override_dh_install: find debian/tmp -name '*.la' -delete dh_install --fail-missing override_dh_strip: dh_strip -plibdri2-1 --dbg-package=libdri2-dbg dh_strip -s --remaining-packages %: dh $@ --with quilt,autoreconf --builddirectory=build/