From: <al...@ke...> - 2015-03-14 15:39:28
|
configure.ac | 2 ++ xf86drm.c | 3 +++ 2 files changed, 5 insertions(+) New commits: commit 0e1135de5cbb783846a4f7e9ef8a5f953f7c77ae Author: Alan Coopersmith <ala...@or...> Date: Sat Mar 7 11:44:32 2015 -0800 On Solaris, #include <sys/mkdev.h> in xf86drm.c Needed on Solaris for the definitions of major() & minor() used in drmGetNodeTypeFromFd() and makedev() used in drmOpenMinor() Signed-off-by: Alan Coopersmith <ala...@or...> Reviewed-by: Emil Velikov <emi...@gm...> diff --git a/configure.ac b/configure.ac index 106d970..1fd0818 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,8 @@ AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE AC_FUNC_ALLOCA +AC_CHECK_HEADERS([sys/mkdev.h]) + # Initialize libtool LT_PREREQ([2.2]) LT_INIT([disable-static]) diff --git a/xf86drm.c b/xf86drm.c index 194cd35..34728be 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -52,6 +52,9 @@ #include <sys/ioctl.h> #include <sys/time.h> #include <stdarg.h> +#ifdef HAVE_SYS_MKDEV_H +# include <sys/mkdev.h> /* defines major(), minor(), and makedev() on Solaris */ +#endif /* Not all systems have MAP_FAILED defined */ #ifndef MAP_FAILED |
From: <jv...@ke...> - 2015-03-16 21:48:13
|
tests/drmstat.c | 2 +- tests/kmstest/main.c | 2 +- tests/modeprint/modeprint.c | 18 +++++++++--------- tests/proptest/proptest.c | 2 +- tests/radeon/radeon_ttm.c | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) New commits: commit d729d75f8449c6968f988d8b93ec33a1ba5a2c38 Author: Jan Vesely <jan...@ru...> Date: Fri Feb 27 11:43:44 2015 -0500 Add static qualifier to local functions v2: Don't bother marking dead functions static (handler, xf86VDrvMsgVerb, drmSetDebugMsgFunction) Signed-off-by: Jan Vesely <jan...@ru...> Reviewed-by: Emil Velikov <emi...@gm...> diff --git a/tests/drmstat.c b/tests/drmstat.c index 5935d07..c6ff1ff 100644 --- a/tests/drmstat.c +++ b/tests/drmstat.c @@ -87,7 +87,7 @@ void handler(int fd, void *oldctx, void *newctx) printf("Got fd %d\n", fd); } -void process_sigio(char *device) +static void process_sigio(char *device) { int fd; diff --git a/tests/kmstest/main.c b/tests/kmstest/main.c index 59e6113..1d4c63e 100644 --- a/tests/kmstest/main.c +++ b/tests/kmstest/main.c @@ -37,7 +37,7 @@ return ret; \ } -int test_bo(struct kms_driver *kms) +static int test_bo(struct kms_driver *kms) { struct kms_bo *bo; int ret; diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c index 6f0d039..de59cbd 100644 --- a/tests/modeprint/modeprint.c +++ b/tests/modeprint/modeprint.c @@ -53,7 +53,7 @@ int crtcs; int fbs; char *module_name; -const char* getConnectionText(drmModeConnection conn) +static const char* getConnectionText(drmModeConnection conn) { switch (conn) { case DRM_MODE_CONNECTED: @@ -66,7 +66,7 @@ const char* getConnectionText(drmModeConnection conn) } -int printMode(struct drm_mode_modeinfo *mode) +static int printMode(struct drm_mode_modeinfo *mode) { if (full_modes) { printf("Mode: %s\n", mode->name); @@ -90,7 +90,7 @@ int printMode(struct drm_mode_modeinfo *mode) return 0; } -int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_t value) +static int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_t value) { const char *name = NULL; int j; @@ -161,7 +161,7 @@ static const char * const output_names[] = { "None", "DSI", }; -int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connector, uint32_t id) +static int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connector, uint32_t id) { int i = 0; struct drm_mode_modeinfo *mode = NULL; @@ -214,7 +214,7 @@ int printConnector(int fd, drmModeResPtr res, drmModeConnectorPtr connector, uin return 0; } -int printEncoder(int fd, drmModeResPtr res, drmModeEncoderPtr encoder, uint32_t id) +static int printEncoder(int fd, drmModeResPtr res, drmModeEncoderPtr encoder, uint32_t id) { printf("Encoder\n"); printf("\tid :%i\n", id); @@ -225,7 +225,7 @@ int printEncoder(int fd, drmModeResPtr res, drmModeEncoderPtr encoder, uint32_t return 0; } -int printCrtc(int fd, drmModeResPtr res, drmModeCrtcPtr crtc, uint32_t id) +static int printCrtc(int fd, drmModeResPtr res, drmModeCrtcPtr crtc, uint32_t id) { printf("Crtc\n"); printf("\tid : %i\n", id); @@ -239,7 +239,7 @@ int printCrtc(int fd, drmModeResPtr res, drmModeCrtcPtr crtc, uint32_t id) return 0; } -int printFrameBuffer(int fd, drmModeResPtr res, drmModeFBPtr fb) +static int printFrameBuffer(int fd, drmModeResPtr res, drmModeFBPtr fb) { printf("Framebuffer\n"); printf("\thandle : %i\n", fb->handle); @@ -253,7 +253,7 @@ int printFrameBuffer(int fd, drmModeResPtr res, drmModeFBPtr fb) return 0; } -int printRes(int fd, drmModeResPtr res) +static int printRes(int fd, drmModeResPtr res) { int i; drmModeFBPtr fb; @@ -329,7 +329,7 @@ int printRes(int fd, drmModeResPtr res) return 0; } -void args(int argc, char **argv) +static void args(int argc, char **argv) { int i; diff --git a/tests/proptest/proptest.c b/tests/proptest/proptest.c index 4b7234d..9b2eb3f 100644 --- a/tests/proptest/proptest.c +++ b/tests/proptest/proptest.c @@ -44,7 +44,7 @@ static inline int64_t U642I64(uint64_t val) int fd; drmModeResPtr res = NULL; -const char *connector_type_str(uint32_t type) +static const char *connector_type_str(uint32_t type) { switch (type) { case DRM_MODE_CONNECTOR_Unknown: diff --git a/tests/radeon/radeon_ttm.c b/tests/radeon/radeon_ttm.c index ac3297a..8346e85 100644 --- a/tests/radeon/radeon_ttm.c +++ b/tests/radeon/radeon_ttm.c @@ -32,7 +32,7 @@ /* allocate as many single page bo to try to starve the kernel * memory zone (below highmem) */ -void ttm_starve_kernel_private_memory(int fd) +static void ttm_starve_kernel_private_memory(int fd) { struct list_head list; struct rbo *bo, *tmp; @@ -55,7 +55,7 @@ void ttm_starve_kernel_private_memory(int fd) } } -int radeon_open_fd(void) +static int radeon_open_fd(void) { return drmOpen("radeon", NULL); } |
From: <da...@ke...> - 2015-03-18 18:18:13
|
include/drm/i915_drm.h | 2 ++ intel/intel_bufmgr.h | 3 +++ intel/intel_bufmgr_gem.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) New commits: commit d556e068a7e4e9dfb57514244ae5f3e0eb9d0b39 Author: Jeff McGee <jef...@in...> Date: Mon Mar 9 16:13:03 2015 -0700 intel: Export total subslice and EU counts Update kernel interface with new I915_GETPARAM ioctl entries for subslice total and EU total. Add a wrapping function for each parameter. Userspace drivers need these values when constructing GPGPU commands. This kernel query method is intended to replace the PCI ID-based tables that userspace drivers currently maintain. The kernel driver can employ fuse register reads as needed to ensure the most accurate determination of GT config attributes. This first became important with Cherryview in which the config could differ between devices with the same PCI ID. The kernel detection of these values is device-specific. Userspace drivers should continue to maintain ID-based tables for older devices which return ENODEV when using this query. v2: remove unnecessary include of <stdbool.h> and increment the I915_GETPARAM indices to match updated kernel patch. For: VIZ-4636 Reviewed-by: Damien Lespiau <dam...@in...> Signed-off-by: Jeff McGee <jef...@in...> Signed-off-by: Damien Lespiau <dam...@in...> diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 15dd01d..b037e56 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -340,6 +340,8 @@ typedef struct drm_i915_irq_wait { #define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 #define I915_PARAM_HAS_WT 27 #define I915_PARAM_CMD_PARSER_VERSION 28 +#define I915_PARAM_SUBSLICE_TOTAL 33 +#define I915_PARAM_EU_TOTAL 34 typedef struct drm_i915_getparam { int param; diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h index be83a56..285919e 100644 --- a/intel/intel_bufmgr.h +++ b/intel/intel_bufmgr.h @@ -264,6 +264,9 @@ int drm_intel_get_reset_stats(drm_intel_context *ctx, uint32_t *active, uint32_t *pending); +int drm_intel_get_subslice_total(int fd, unsigned int *subslice_total); +int drm_intel_get_eu_total(int fd, unsigned int *eu_total); + /** @{ Compatibility defines to keep old code building despite the symbol rename * from dri_* to drm_intel_* */ diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index acbfd4a..5a67f53 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -3295,6 +3295,37 @@ drm_intel_reg_read(drm_intel_bufmgr *bufmgr, return ret; } +drm_public int +drm_intel_get_subslice_total(int fd, unsigned int *subslice_total) +{ + drm_i915_getparam_t gp; + int ret; + + memclear(gp); + gp.value = (int*)subslice_total; + gp.param = I915_PARAM_SUBSLICE_TOTAL; + ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); + if (ret) + return -errno; + + return 0; +} + +drm_public int +drm_intel_get_eu_total(int fd, unsigned int *eu_total) +{ + drm_i915_getparam_t gp; + int ret; + + memclear(gp); + gp.value = (int*)eu_total; + gp.param = I915_PARAM_EU_TOTAL; + ret = drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp); + if (ret) + return -errno; + + return 0; +} /** * Annotate the given bo for use in aub dumping. |
From: <da...@ke...> - 2015-03-19 14:40:23
|
configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 5f7b6723e1bed755c230817eea0563bab5b2a8a7 Author: Damien Lespiau <dam...@in...> Date: Thu Mar 19 14:36:56 2015 +0000 build: Bump version number to 2.4.60 before release Signed-off-by: Damien Lespiau <dam...@in...> diff --git a/configure.ac b/configure.ac index 6e45fa8..155d577 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AC_PREREQ([2.63]) AC_INIT([libdrm], - [2.4.59], + [2.4.60], [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI], [libdrm]) |
From: <da...@ke...> - 2015-03-19 17:23:55
|
include/drm/i915_drm.h | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) New commits: commit 8576527cfacaf42af8316e1030c192193e94225a Author: Neil Roberts <ne...@li...> Date: Thu Mar 19 17:11:08 2015 +0000 intel: Merge latest i915_drm.h The main incentive to do this is to get I915_PARAM_REVISION. v2: Rebase on top of some changes that were made to the header without copying the whole file from the kernel source. Reviewed-by: Damien Lespiau <dam...@in...> Signed-off-by: Neil Roberts <ne...@li...> Signed-off-by: Damien Lespiau <dam...@in...> diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index b037e56..ded43b1 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h @@ -224,6 +224,8 @@ typedef struct _drm_i915_sarea { #define DRM_I915_REG_READ 0x31 #define DRM_I915_GET_RESET_STATS 0x32 #define DRM_I915_GEM_USERPTR 0x33 +#define DRM_I915_GEM_CONTEXT_GETPARAM 0x34 +#define DRM_I915_GEM_CONTEXT_SETPARAM 0x35 #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) @@ -274,7 +276,9 @@ typedef struct _drm_i915_sarea { #define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) #define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read) #define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats) -#define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr) +#define DRM_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_USERPTR, struct drm_i915_gem_userptr) +#define DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_GETPARAM, struct drm_i915_gem_context_param) +#define DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_SETPARAM, struct drm_i915_gem_context_param) /* Allow drivers to submit batchbuffers directly to hardware, relying * on the security mechanisms provided by hardware. @@ -340,6 +344,10 @@ typedef struct drm_i915_irq_wait { #define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 #define I915_PARAM_HAS_WT 27 #define I915_PARAM_CMD_PARSER_VERSION 28 +#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29 +#define I915_PARAM_MMAP_VERSION 30 +#define I915_PARAM_HAS_BSD2 31 +#define I915_PARAM_REVISION 32 #define I915_PARAM_SUBSLICE_TOTAL 33 #define I915_PARAM_EU_TOTAL 34 @@ -489,6 +497,14 @@ struct drm_i915_gem_mmap { * This is a fixed-size type for 32/64 compatibility. */ __u64 addr_ptr; + + /** + * Flags for extended behaviour. + * + * Added in version 2. + */ + __u64 flags; +#define I915_MMAP_WC 0x1 }; struct drm_i915_gem_mmap_gtt { @@ -738,7 +754,13 @@ struct drm_i915_gem_execbuffer2 { */ #define I915_EXEC_HANDLE_LUT (1<<12) -#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_HANDLE_LUT<<1) +/** Used for switching BSD rings on the platforms with two BSD rings */ +#define I915_EXEC_BSD_MASK (3<<13) +#define I915_EXEC_BSD_DEFAULT (0<<13) /* default ping-pong mode */ +#define I915_EXEC_BSD_RING1 (1<<13) +#define I915_EXEC_BSD_RING2 (2<<13) + +#define __I915_EXEC_UNKNOWN_FLAGS -(1<<15) #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) #define i915_execbuffer2_set_context_id(eb2, context) \ @@ -878,6 +900,12 @@ struct drm_i915_gem_get_tiling { * mmap mapping. */ __u32 swizzle_mode; + + /** + * Returned address bit 6 swizzling required for CPU access through + * mmap mapping whilst bound. + */ + __u32 phys_swizzle_mode; }; struct drm_i915_gem_get_aperture { @@ -1061,11 +1089,19 @@ struct drm_i915_gem_userptr { #define I915_USERPTR_READ_ONLY 0x1 #define I915_USERPTR_UNSYNCHRONIZED 0x80000000 /** - * Returned handle for the object. - * - * Object handles are nonzero. - */ + * Returned handle for the object. + * + * Object handles are nonzero. + */ __u32 handle; }; +struct drm_i915_gem_context_param { + __u32 ctx_id; + __u32 size; + __u64 param; +#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1 + __u64 value; +}; + #endif /* _I915_DRM_H_ */ |
From: <jv...@ke...> - 2015-03-20 17:41:10
|
tests/drmstat.c | 13 ------------- xf86drm.c | 2 ++ 2 files changed, 2 insertions(+), 13 deletions(-) New commits: commit 6fc0e4ba1ea153ff949cba0002fc5ed544de0de0 Author: Jan Vesely <jan...@ru...> Date: Fri Feb 27 12:54:34 2015 -0500 Fix unused function warnings v2: Remove the handler function instead of commenting out split debugmsg function removal to a separate patch Signed-off-by: Jan Vesely <jan...@ru...> Reviewed-by: Emil Velikov <emi...@gm...> diff --git a/tests/drmstat.c b/tests/drmstat.c index c6ff1ff..c800ebb 100644 --- a/tests/drmstat.c +++ b/tests/drmstat.c @@ -81,11 +81,6 @@ static void getversion(int fd) printf( "No driver available\n" ); } } - -void handler(int fd, void *oldctx, void *newctx) -{ - printf("Got fd %d\n", fd); -} static void process_sigio(char *device) { @@ -97,7 +92,6 @@ static void process_sigio(char *device) } sigio_fd = fd; - /* drmInstallSIGIOHandler(fd, handler); */ for (;;) sleep(60); } @@ -427,11 +421,4 @@ int main(int argc, char **argv) return r; } -void DRM_PRINTFLIKE(4, 0) -xf86VDrvMsgVerb(int scrnIndex, int type, int verb, const char *format, - va_list args) -{ - vfprintf(stderr, format, args); -} - int xf86ConfigDRI[10]; diff --git a/xf86drm.c b/xf86drm.c index 051ed5d..43d0700 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -277,6 +277,7 @@ static int drmMatchBusID(const char *id1, const char *id2, int pci_domain_ok) * If any other failure happened then it will output error mesage using * drmMsg() call. */ +#if !defined(UDEV) static int chown_check_return(const char *path, uid_t owner, gid_t group) { int rv; @@ -292,6 +293,7 @@ static int chown_check_return(const char *path, uid_t owner, gid_t group) path, errno, strerror(errno)); return -1; } +#endif /** * Open the DRM device, creating it if necessary. |
From: <jv...@ke...> - 2015-03-20 21:41:08
|
xf86drm.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) New commits: commit cfbe9c9807888d24a56d9b1df28db7da669dee85 Author: Jan Vesely <jan...@ru...> Date: Wed Mar 18 14:17:26 2015 -0400 Remove drmSetDebugMsgFunction and related infrastructure Not used anywhere Signed-off-by: Jan Vesely <jan...@ru...> Reviewed-by: Emil Velikov <emi...@gm...> diff --git a/xf86drm.c b/xf86drm.c index 43d0700..e73cddd 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -114,11 +114,6 @@ drmDebugPrint(const char *format, va_list ap) return vfprintf(stderr, format, ap); } -typedef int DRM_PRINTFLIKE(1, 0) (*debug_msg_func_t)(const char *format, - va_list ap); - -static debug_msg_func_t drm_debug_print = drmDebugPrint; - void drmMsg(const char *format, ...) { @@ -130,18 +125,12 @@ drmMsg(const char *format, ...) if (drm_server_info) { drm_server_info->debug_print(format,ap); } else { - drm_debug_print(format, ap); + drmDebugPrint(format, ap); } va_end(ap); } } -void -drmSetDebugMsgFunction(debug_msg_func_t debug_msg_ptr) -{ - drm_debug_print = debug_msg_ptr; -} - static void *drmHashTable = NULL; /* Context switch callbacks */ void *drmGetHashTable(void) |
From: <jv...@ke...> - 2015-03-20 22:21:01
|
tests/exynos/exynos_fimg2d_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8dff7a04780a0f028aa7c0218806a5ee59b1a40d Author: Jan Vesely <jan...@ru...> Date: Wed Mar 18 14:23:47 2015 -0400 tests/exynos: Fix missing static keyword Signed-off-by: Jan Vesely <jan...@ru...> Reviewed-by: Tobias Jakobi <tj...@ma...> diff --git a/tests/exynos/exynos_fimg2d_test.c b/tests/exynos/exynos_fimg2d_test.c index 880bb89..e64bb32 100644 --- a/tests/exynos/exynos_fimg2d_test.c +++ b/tests/exynos/exynos_fimg2d_test.c @@ -214,7 +214,7 @@ static struct exynos_bo *exynos_create_buffer(struct exynos_device *dev, /* Allocate buffer and fill it with checkerboard pattern, where the tiles * * have a random color. The caller has to free the buffer. */ -void *create_checkerboard_pattern(unsigned int num_tiles_x, +static void *create_checkerboard_pattern(unsigned int num_tiles_x, unsigned int num_tiles_y, unsigned int tile_size) { unsigned int *buf; |
From: <eve...@ke...> - 2015-03-26 20:35:28
|
intel/Android.mk | 3 --- 1 file changed, 3 deletions(-) New commits: commit bc6b5174d362a01f6d638a4db6aaf2fd355db69c Author: Emil Velikov <emi...@gm...> Date: Fri Mar 20 18:38:35 2015 +0000 android: remove explicit include to libpciaccess Both android-x86 and android-ia versions of libpciacccess correctly "export" the include. If anyone else is wrapping up their own version they should do so as well. Remove this fixed location hack from the build. Signed-off-by: Emil Velikov <emi...@gm...> Reviewed-by: Chih-Wei Huang <cw...@li...> diff --git a/intel/Android.mk b/intel/Android.mk index 0f498ec..6582dfd 100644 --- a/intel/Android.mk +++ b/intel/Android.mk @@ -33,9 +33,6 @@ LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES) LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) -LOCAL_C_INCLUDES := \ - external/libpciaccess/include - LOCAL_CFLAGS := \ -DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1 |
From: <eve...@ke...> - 2015-04-09 15:25:45
|
tests/modetest/Android.mk | 2 -- 1 file changed, 2 deletions(-) New commits: commit 6f90b77ea903756c87ae614c093e3d816ebb26fc Author: Chih-Wei Huang <cw...@an...> Date: Tue Mar 31 15:32:13 2015 +0800 android: remove unnecessary TARGET_OUT_HEADERS variable Signed-off-by: Chih-Wei Huang <cw...@li...> Reviewed-by: Emil Velikov <emi...@gm...> diff --git a/tests/modetest/Android.mk b/tests/modetest/Android.mk index aee3564..0fdfe68 100644 --- a/tests/modetest/Android.mk +++ b/tests/modetest/Android.mk @@ -7,8 +7,6 @@ LOCAL_SRC_FILES := $(MODETEST_FILES) LOCAL_MODULE := modetest -LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/libdrm - LOCAL_SHARED_LIBRARIES := libdrm include $(BUILD_EXECUTABLE) |
From: <rob...@ke...> - 2015-04-15 13:35:38
|
tests/modetest/modetest.c | 5 +++++ 1 file changed, 5 insertions(+) New commits: commit 0d78b37b1cac304ce5e84d1207f0a43abd29c000 Author: Rob Clark <rob...@fr...> Date: Wed Apr 15 09:35:00 2015 -0400 modeprint: add missing encoder/connector type names Signed-off-by: Rob Clark <rob...@fr...> diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 5f46efd..53dfe05 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -140,6 +140,9 @@ struct type_name encoder_type_names[] = { { DRM_MODE_ENCODER_TMDS, "TMDS" }, { DRM_MODE_ENCODER_LVDS, "LVDS" }, { DRM_MODE_ENCODER_TVDAC, "TVDAC" }, + { DRM_MODE_ENCODER_VIRTUAL, "Virtual" }, + { DRM_MODE_ENCODER_DSI, "DSI" }, + { DRM_MODE_ENCODER_DPMST, "DPMST" }, }; static type_name_fn(encoder_type) @@ -168,6 +171,8 @@ struct type_name connector_type_names[] = { { DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" }, { DRM_MODE_CONNECTOR_TV, "TV" }, { DRM_MODE_CONNECTOR_eDP, "eDP" }, + { DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" }, + { DRM_MODE_CONNECTOR_DSI, "DSI" }, }; static type_name_fn(connector_type) |
From: <da...@ke...> - 2015-04-29 14:28:07
|
intel/intel_bufmgr_gem.c | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) New commits: commit 30921483c70c6939f017476eac13da6aa26b3b3c Author: Tvrtko Ursulin <tvr...@in...> Date: Fri Apr 17 11:57:28 2015 +0100 intel: Leak the userptr test bo In order to use userptr, the kernel tracks the owner's mm with a mmu_notifier. Setting that is very expensive - it involves taking all mm_locks and a stop_machine(). This tracking lives only for as long as the client is using userptr objects - so if the client allocates then frees a userptr in a loop, we will be executing that heavyweight setup everytime. To ammoritize this cost, just leak the test bo and the single backing page we use for detecting userptr. v2: Free the object and memory when bufmgr is destroyed. Reviewed-by: Chris Wilson <ch...@ch...> Signed-off-by: Tvrtko Ursulin <tvr...@in...> Cc: Chris Wilson <ch...@ch...> Signed-off-by: Damien Lespiau <dam...@in...> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index 7c94786..60c06fc 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -132,6 +132,11 @@ typedef struct _drm_intel_bufmgr_gem { unsigned int has_vebox : 1; bool fenced_relocs; + struct { + void *ptr; + uint32_t handle; + } userptr_active; + char *aub_filename; FILE *aub_file; uint32_t aub_offset; @@ -943,7 +948,6 @@ has_userptr(drm_intel_bufmgr_gem *bufmgr_gem) void *ptr; long pgsz; struct drm_i915_gem_userptr userptr; - struct drm_gem_close close_bo; pgsz = sysconf(_SC_PAGESIZE); assert(pgsz > 0); @@ -970,15 +974,15 @@ retry: return false; } - memclear(close_bo); - close_bo.handle = userptr.handle; - ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_CLOSE, &close_bo); - free(ptr); - if (ret) { - fprintf(stderr, "Failed to release test userptr object! (%d) " - "i915 kernel driver may not be sane!\n", errno); - return false; - } + /* We don't release the userptr bo here as we want to keep the + * kernel mm tracking alive for our lifetime. The first time we + * create a userptr object the kernel has to install a mmu_notifer + * which is a heavyweight operation (e.g. it requires taking all + * mm_locks and stop_machine()). + */ + + bufmgr_gem->userptr_active.ptr = ptr; + bufmgr_gem->userptr_active.handle = userptr.handle; return true; } @@ -1805,7 +1809,8 @@ static void drm_intel_bufmgr_gem_destroy(drm_intel_bufmgr *bufmgr) { drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr; - int i; + struct drm_gem_close close_bo; + int i, ret; free(bufmgr_gem->exec2_objects); free(bufmgr_gem->exec_objects); @@ -1829,6 +1834,18 @@ drm_intel_bufmgr_gem_destroy(drm_intel_bufmgr *bufmgr) } } + /* Release userptr bo kept hanging around for optimisation. */ + if (bufmgr_gem->userptr_active.ptr) { + memclear(close_bo); + close_bo.handle = bufmgr_gem->userptr_active.handle; + ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_CLOSE, &close_bo); + free(bufmgr_gem->userptr_active.ptr); + if (ret) + fprintf(stderr, + "Failed to release test userptr object! (%d) " + "i915 kernel driver may not be sane!\n", errno); + } + free(bufmgr); } |
From: <rob...@ke...> - 2015-05-05 15:17:36
|
tests/modetest/buffers.c | 2 ++ 1 file changed, 2 insertions(+) New commits: commit b4defea65fac690aefbe5348ff6ac2976e0ee090 Author: Rob Clark <rob...@fr...> Date: Tue May 5 11:16:23 2015 -0400 modetest: fix allocation for yuv420/yvu420 Signed-off-by: Rob Clark <rob...@fr...> diff --git a/tests/modetest/buffers.c b/tests/modetest/buffers.c index 6f5feab..7e214e8 100644 --- a/tests/modetest/buffers.c +++ b/tests/modetest/buffers.c @@ -1162,6 +1162,8 @@ bo_create(int fd, unsigned int format, switch (format) { case DRM_FORMAT_NV12: case DRM_FORMAT_NV21: + case DRM_FORMAT_YUV420: + case DRM_FORMAT_YVU420: virtual_height = height * 3 / 2; break; |
From: <dar...@ke...> - 2015-05-06 04:50:30
|
nouveau/nouveau.c | 10 ++++++++++ 1 file changed, 10 insertions(+) New commits: commit 812e8fe6ce46d733c30207ee26c788c61f546294 Author: Ben Skeggs <bs...@re...> Date: Wed May 6 14:34:22 2015 +1000 nouveau: restore check that avoids multiple user bos per kernel bo Lost in 5ea6f1c32628887c9df0c53bc8c199eb12633fec, triggering fdo#89842. Unlike the PRIME fd->handle interfaces, the GEM_OPEN interface doesn't do anything at the kernel level to prevent this situation occuring, and we end up with multiple GEM handles for a single kernel buffer. Signed-off-by: Ben Skeggs <bs...@re...> diff --git a/nouveau/nouveau.c b/nouveau/nouveau.c index 0071249..7393474 100644 --- a/nouveau/nouveau.c +++ b/nouveau/nouveau.c @@ -480,10 +480,20 @@ nouveau_bo_name_ref(struct nouveau_device *dev, uint32_t name, struct nouveau_bo **pbo) { struct nouveau_device_priv *nvdev = nouveau_device(dev); + struct nouveau_bo_priv *nvbo; struct drm_gem_open req = { .name = name }; int ret; pthread_mutex_lock(&nvdev->lock); + DRMLISTFOREACHENTRY(nvbo, &nvdev->bo_list, head) { + if (nvbo->name == name) { + ret = nouveau_bo_wrap_locked(dev, nvbo->base.handle, + pbo, name); + pthread_mutex_unlock(&nvdev->lock); + return ret; + } + } + ret = drmIoctl(dev->fd, DRM_IOCTL_GEM_OPEN, &req); if (ret == 0) { ret = nouveau_bo_wrap_locked(dev, req.handle, pbo, name); |
From: <dar...@ke...> - 2015-05-06 23:38:09
|
configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit b2360626c4aa1dccdf3fe258b833121748d64d35 Author: Ben Skeggs <bs...@re...> Date: Thu May 7 09:06:31 2015 +1000 configure.ac: bump version to 2.4.61 for release Signed-off-by: Ben Skeggs <bs...@re...> diff --git a/configure.ac b/configure.ac index f8adf4f..78a0010 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AC_PREREQ([2.63]) AC_INIT([libdrm], - [2.4.60], + [2.4.61], [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI], [libdrm]) |
From: <da...@ke...> - 2015-05-18 15:25:15
|
intel/intel_chipset.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) New commits: commit e9ea1f42d14e10852f292f3470aee260c7349978 Author: Damien Lespiau <dam...@in...> Date: Fri May 15 19:34:12 2015 +0100 intel: Add the Broxton PCI IDs Cc: Imre Deak <imr...@in...> Reviewed-by: Imre Deak <imr...@in...> Signed-off-by: Damien Lespiau <dam...@in...> diff --git a/intel/intel_chipset.h b/intel/intel_chipset.h index e22a867..253ea71 100644 --- a/intel/intel_chipset.h +++ b/intel/intel_chipset.h @@ -181,6 +181,10 @@ #define PCI_CHIP_SKYLAKE_SRV_GT1 0x190A #define PCI_CHIP_SKYLAKE_WKS_GT2 0x191D +#define PCI_CHIP_BROXTON_0 0x0A84 +#define PCI_CHIP_BROXTON_1 0x1A84 +#define PCI_CHIP_BROXTON_2 0x5A84 + #define IS_MOBILE(devid) ((devid) == PCI_CHIP_I855_GM || \ (devid) == PCI_CHIP_I915_GM || \ (devid) == PCI_CHIP_I945_GM || \ @@ -362,7 +366,12 @@ IS_SKL_GT2(devid) || \ IS_SKL_GT3(devid)) -#define IS_GEN9(devid) IS_SKYLAKE(devid) +#define IS_BROXTON(devid) ((devid) == PCI_CHIP_BROXTON_0 || \ + (devid) == PCI_CHIP_BROXTON_1 || \ + (devid) == PCI_CHIP_BROXTON_2) + +#define IS_GEN9(devid) (IS_SKYLAKE(devid) || \ + IS_BROXTON(devid)) #define IS_9XX(dev) (IS_GEN3(dev) || \ IS_GEN4(dev) || \ |
From: <mp...@ke...> - 2015-05-21 18:22:51
|
include/drm/nouveau_drm.h | 1 + nouveau/abi16.c | 3 +++ nouveau/nouveau.h | 1 + 3 files changed, 5 insertions(+) New commits: commit a1acffd4e0968ffa65b673163574188a00c9ab7e Author: Alexandre Courbot <aco...@nv...> Date: Thu May 21 15:08:28 2015 +0900 nouveau: add coherent BO attribute Add a flag allowing Nouveau to specify that an object should be coherent at allocation time. This is required for some class of objects like fences which are randomly-accessed by both the CPU and GPU. This flag instructs the kernel driver to make sure the object remains coherent even on architectures for which coherency is not guaranteed by the bus. Reviewed-by: Ben Skeggs <bs...@re...> Signed-off-by: Alexandre Courbot <aco...@nv...> diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h index b18cad0..87aefc5 100644 --- a/include/drm/nouveau_drm.h +++ b/include/drm/nouveau_drm.h @@ -96,6 +96,7 @@ struct drm_nouveau_setparam { #define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1) #define NOUVEAU_GEM_DOMAIN_GART (1 << 2) #define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3) +#define NOUVEAU_GEM_DOMAIN_COHERENT (1 << 4) #define NOUVEAU_GEM_TILE_LAYOUT_MASK 0x0000ff00 #define NOUVEAU_GEM_TILE_16BPP 0x00000001 diff --git a/nouveau/abi16.c b/nouveau/abi16.c index 538f3a7..4ca0bfb 100644 --- a/nouveau/abi16.c +++ b/nouveau/abi16.c @@ -195,6 +195,9 @@ abi16_bo_init(struct nouveau_bo *bo, uint32_t alignment, if (bo->flags & NOUVEAU_BO_MAP) info->domain |= NOUVEAU_GEM_DOMAIN_MAPPABLE; + if (bo->flags & NOUVEAU_BO_COHERENT) + info->domain |= NOUVEAU_GEM_DOMAIN_COHERENT; + if (!(bo->flags & NOUVEAU_BO_CONTIG)) info->tile_flags = NOUVEAU_GEM_TILE_NONCONTIG; diff --git a/nouveau/nouveau.h b/nouveau/nouveau.h index a55e2b0..4adda0e 100644 --- a/nouveau/nouveau.h +++ b/nouveau/nouveau.h @@ -127,6 +127,7 @@ union nouveau_bo_config { #define NOUVEAU_BO_MAP 0x80000000 #define NOUVEAU_BO_CONTIG 0x40000000 #define NOUVEAU_BO_NOSNOOP 0x20000000 +#define NOUVEAU_BO_COHERENT 0x10000000 struct nouveau_bo { struct nouveau_device *device; |
From: <im...@ke...> - 2015-06-24 15:32:37
|
nouveau/pushbuf.c | 4 ++++ 1 file changed, 4 insertions(+) New commits: commit 203983f842a889b279698fdea46e83ee4450a1db Author: Ilia Mirkin <im...@al...> Date: Sun Jun 21 19:26:42 2015 -0400 nouveau: add asserts to make sure krefs are there This should help catch odd bugs at the callsites rather than much later on with completely bogus bo indices. Signed-off-by: Ilia Mirkin <im...@al...> diff --git a/nouveau/pushbuf.c b/nouveau/pushbuf.c index 4f77881..8e7dcdf 100644 --- a/nouveau/pushbuf.c +++ b/nouveau/pushbuf.c @@ -234,6 +234,8 @@ pushbuf_krel(struct nouveau_pushbuf *push, struct nouveau_bo *bo, bkref = cli_kref_get(push->client, bo); krel = &krec->reloc[krec->nr_reloc++]; + assert(pkref); + assert(bkref); krel->reloc_bo_index = pkref - krec->buffer; krel->reloc_bo_offset = (push->cur - nvpb->ptr) * 4; krel->bo_index = bkref - krec->buffer; @@ -721,6 +723,7 @@ nouveau_pushbuf_data(struct nouveau_pushbuf *push, struct nouveau_bo *bo, if (bo) { kref = cli_kref_get(push->client, bo); + assert(kref); kpsh = &krec->push[krec->nr_push++]; kpsh->bo_index = kref - krec->buffer; kpsh->offset = offset; @@ -757,6 +760,7 @@ nouveau_pushbuf_refd(struct nouveau_pushbuf *push, struct nouveau_bo *bo) if (cli_push_get(push->client, bo) == push) { kref = cli_kref_get(push->client, bo); + assert(kref); if (kref->read_domains) flags |= NOUVEAU_BO_RD; if (kref->write_domains) |
From: <eve...@ke...> - 2015-06-30 12:59:25
|
configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 676c806d0221a7ea375676b2eab514c426fcacd3 Author: Emil Velikov <emi...@gm...> Date: Tue Jun 30 14:01:14 2015 +0100 configure: default --enable-valgrind to auto ... as the help text says. Reported-by: Jasper St. Pierre <jst...@me...> Signed-off-by: Emil Velikov <emi...@gm...> diff --git a/configure.ac b/configure.ac index 1456b90..001fd3d 100644 --- a/configure.ac +++ b/configure.ac @@ -406,7 +406,7 @@ AM_CONDITIONAL([HAVE_MANPAGES_STYLESHEET], [test "x$HAVE_MANPAGES_STYLESHEET" = AC_ARG_ENABLE(valgrind, [AS_HELP_STRING([--enable-valgrind], [Build libdrm with valgrind support (default: auto)])], - [VALGRIND=$enableval], [VALGRIND=yes]) + [VALGRIND=$enableval], [VALGRIND=auto]) PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no]) AC_MSG_CHECKING([whether to enable Valgrind support]) if test "x$VALGRIND" = xauto; then |
From: <ic...@ke...> - 2015-07-28 17:09:32
|
xf86drmMode.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit 1a6efaf68e207302cd9423051b8091fa663bbabe Author: Chris Wilson <ch...@ch...> Date: Tue Jul 21 13:46:45 2015 +0100 drm: Detect no-op drmModeAtomicRequest and return early If the number of items to process in the request is zero, we can forgo duplicating, sorting the request and feeding it into the kernel and instead report success immediately. This prevents a NULL dereference of the sorted->items for the no-op request. Fixes: ed44e0b9585c563905447eceed12af9c1c7ca8d4 Signed-off-by: Chris Wilson <ch...@ch...> Cc: Ville Syrjälä <vil...@li...> Cc: Rob Clark <rob...@fr...> Cc: Daniel Stone <da...@co...> Cc: Emil Velikov <emi...@gm...> Reviewed-by: Emil Velikov <emi...@gm...> diff --git a/xf86drmMode.c b/xf86drmMode.c index 529429e..fa21986 100644 --- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -1289,7 +1289,7 @@ static int sort_req_list(const void *misc, const void *other) int drmModeAtomicCommit(int fd, drmModeAtomicReqPtr req, uint32_t flags, void *user_data) { - drmModeAtomicReqPtr sorted = drmModeAtomicDuplicate(req); + drmModeAtomicReqPtr sorted; struct drm_mode_atomic atomic; uint32_t *objs_ptr = NULL; uint32_t *count_props_ptr = NULL; @@ -1300,7 +1300,11 @@ int drmModeAtomicCommit(int fd, drmModeAtomicReqPtr req, uint32_t flags, int obj_idx = -1; int ret = -1; - if (!sorted) + if (req->cursor == 0) + return 0; + + sorted = drmModeAtomicDuplicate(req); + if (sorted == NULL) return -ENOMEM; memclear(atomic); |
From: <kr...@ke...> - 2015-08-03 16:23:46
|
intel/intel_bufmgr_gem.c | 375 ----------------------------------------------- 1 file changed, 5 insertions(+), 370 deletions(-) New commits: commit cd2f91e18db087edf93fed828e568ee53b887860 Author: Kristian Høgsberg Kristensen <kri...@in...> Date: Fri Jul 31 10:47:50 2015 -0700 intel: Drop aub dumping functionality We now have a separate tool for this in intel-gpu-tools and we don't need to clutter up libdrm with this feature. We leave the entry points in there to avoid breaking API/ABI. Install intel-gpu-tools, then run (for example) $ intel_aubdump --output=trace.aub glxgears -geometry 500x500 See the intel_aubdump man page for more details. Reviewed-by: Chris Wilson <ch...@ch...> Signed-off-by: Kristian Høgsberg Kristensen <kri...@in...> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c index b1c3b3a..41de396 100644 --- a/intel/intel_bufmgr_gem.c +++ b/intel/intel_bufmgr_gem.c @@ -61,7 +61,6 @@ #include "intel_bufmgr.h" #include "intel_bufmgr_priv.h" #include "intel_chipset.h" -#include "intel_aub.h" #include "string.h" #include "i915_drm.h" @@ -138,9 +137,6 @@ typedef struct _drm_intel_bufmgr_gem { uint32_t handle; } userptr_active; - char *aub_filename; - FILE *aub_file; - uint32_t aub_offset; } drm_intel_bufmgr_gem; #define DRM_INTEL_RELOC_FENCE (1<<0) @@ -256,11 +252,6 @@ struct _drm_intel_bo_gem { /** Flags that we may need to do the SW_FINSIH ioctl on unmap. */ bool mapped_cpu_write; - - uint32_t aub_offset; - - drm_intel_aub_annotation *aub_annotations; - unsigned aub_annotation_count; }; static unsigned int @@ -789,8 +780,6 @@ retry: bo_gem->used_as_reloc_target = false; bo_gem->has_error = false; bo_gem->reusable = true; - bo_gem->aub_annotations = NULL; - bo_gem->aub_annotation_count = 0; drm_intel_bo_gem_set_in_aperture_size(bufmgr_gem, bo_gem, alignment); @@ -1143,7 +1132,6 @@ drm_intel_gem_bo_free(drm_intel_bo *bo) DBG("DRM_IOCTL_GEM_CLOSE %d failed (%s): %s\n", bo_gem->gem_handle, bo_gem->name, strerror(errno)); } - free(bo_gem->aub_annotations); free(bo); } @@ -1822,7 +1810,6 @@ drm_intel_bufmgr_gem_destroy(drm_intel_bufmgr *bufmgr) free(bufmgr_gem->exec2_objects); free(bufmgr_gem->exec_objects); free(bufmgr_gem->exec_bos); - free(bufmgr_gem->aub_filename); pthread_mutex_destroy(&bufmgr_gem->lock); @@ -2116,297 +2103,12 @@ drm_intel_update_buffer_offsets2 (drm_intel_bufmgr_gem *bufmgr_gem) } } -static void -aub_out(drm_intel_bufmgr_gem *bufmgr_gem, uint32_t data) -{ - fwrite(&data, 1, 4, bufmgr_gem->aub_file); -} - -static void -aub_out_data(drm_intel_bufmgr_gem *bufmgr_gem, void *data, size_t size) -{ - fwrite(data, 1, size, bufmgr_gem->aub_file); -} - -static void -aub_write_bo_data(drm_intel_bo *bo, uint32_t offset, uint32_t size) -{ - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; - uint32_t *data; - unsigned int i; - - data = malloc(bo->size); - drm_intel_bo_get_subdata(bo, offset, size, data); - - /* Easy mode: write out bo with no relocations */ - if (!bo_gem->reloc_count) { - aub_out_data(bufmgr_gem, data, size); - free(data); - return; - } - - /* Otherwise, handle the relocations while writing. */ - for (i = 0; i < size / 4; i++) { - int r; - for (r = 0; r < bo_gem->reloc_count; r++) { - struct drm_i915_gem_relocation_entry *reloc; - drm_intel_reloc_target *info; - - reloc = &bo_gem->relocs[r]; - info = &bo_gem->reloc_target_info[r]; - - if (reloc->offset == offset + i * 4) { - drm_intel_bo_gem *target_gem; - uint32_t val; - - target_gem = (drm_intel_bo_gem *)info->bo; - - val = reloc->delta; - val += target_gem->aub_offset; - - aub_out(bufmgr_gem, val); - data[i] = val; - break; - } - } - if (r == bo_gem->reloc_count) { - /* no relocation, just the data */ - aub_out(bufmgr_gem, data[i]); - } - } - - free(data); -} - -static void -aub_bo_get_address(drm_intel_bo *bo) -{ - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; - - /* Give the object a graphics address in the AUB file. We - * don't just use the GEM object address because we do AUB - * dumping before execution -- we want to successfully log - * when the hardware might hang, and we might even want to aub - * capture for a driver trying to execute on a different - * generation of hardware by disabling the actual kernel exec - * call. - */ - bo_gem->aub_offset = bufmgr_gem->aub_offset; - bufmgr_gem->aub_offset += bo->size; - /* XXX: Handle aperture overflow. */ - assert(bufmgr_gem->aub_offset < 256 * 1024 * 1024); -} - -static void -aub_write_trace_block(drm_intel_bo *bo, uint32_t type, uint32_t subtype, - uint32_t offset, uint32_t size) -{ - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; - - aub_out(bufmgr_gem, - CMD_AUB_TRACE_HEADER_BLOCK | - ((bufmgr_gem->gen >= 8 ? 6 : 5) - 2)); - aub_out(bufmgr_gem, - AUB_TRACE_MEMTYPE_GTT | type | AUB_TRACE_OP_DATA_WRITE); - aub_out(bufmgr_gem, subtype); - aub_out(bufmgr_gem, bo_gem->aub_offset + offset); - aub_out(bufmgr_gem, size); - if (bufmgr_gem->gen >= 8) - aub_out(bufmgr_gem, 0); - aub_write_bo_data(bo, offset, size); -} - -/** - * Break up large objects into multiple writes. Otherwise a 128kb VBO - * would overflow the 16 bits of size field in the packet header and - * everything goes badly after that. - */ -static void -aub_write_large_trace_block(drm_intel_bo *bo, uint32_t type, uint32_t subtype, - uint32_t offset, uint32_t size) -{ - uint32_t block_size; - uint32_t sub_offset; - - for (sub_offset = 0; sub_offset < size; sub_offset += block_size) { - block_size = size - sub_offset; - - if (block_size > 8 * 4096) - block_size = 8 * 4096; - - aub_write_trace_block(bo, type, subtype, offset + sub_offset, - block_size); - } -} - -static void -aub_write_bo(drm_intel_bo *bo) -{ - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; - uint32_t offset = 0; - unsigned i; - - aub_bo_get_address(bo); - - /* Write out each annotated section separately. */ - for (i = 0; i < bo_gem->aub_annotation_count; ++i) { - drm_intel_aub_annotation *annotation = - &bo_gem->aub_annotations[i]; - uint32_t ending_offset = annotation->ending_offset; - if (ending_offset > bo->size) - ending_offset = bo->size; - if (ending_offset > offset) { - aub_write_large_trace_block(bo, annotation->type, - annotation->subtype, - offset, - ending_offset - offset); - offset = ending_offset; - } - } - - /* Write out any remaining unannotated data */ - if (offset < bo->size) { - aub_write_large_trace_block(bo, AUB_TRACE_TYPE_NOTYPE, 0, - offset, bo->size - offset); - } -} - -/* - * Make a ringbuffer on fly and dump it - */ -static void -aub_build_dump_ringbuffer(drm_intel_bufmgr_gem *bufmgr_gem, - uint32_t batch_buffer, int ring_flag) -{ - uint32_t ringbuffer[4096]; - int ring = AUB_TRACE_TYPE_RING_PRB0; /* The default ring */ - int ring_count = 0; - - if (ring_flag == I915_EXEC_BSD) - ring = AUB_TRACE_TYPE_RING_PRB1; - else if (ring_flag == I915_EXEC_BLT) - ring = AUB_TRACE_TYPE_RING_PRB2; - - /* Make a ring buffer to execute our batchbuffer. */ - memset(ringbuffer, 0, sizeof(ringbuffer)); - if (bufmgr_gem->gen >= 8) { - ringbuffer[ring_count++] = AUB_MI_BATCH_BUFFER_START | (3 - 2); - ringbuffer[ring_count++] = batch_buffer; - ringbuffer[ring_count++] = 0; - } else { - ringbuffer[ring_count++] = AUB_MI_BATCH_BUFFER_START; - ringbuffer[ring_count++] = batch_buffer; - } - - /* Write out the ring. This appears to trigger execution of - * the ring in the simulator. - */ - aub_out(bufmgr_gem, - CMD_AUB_TRACE_HEADER_BLOCK | - ((bufmgr_gem->gen >= 8 ? 6 : 5) - 2)); - aub_out(bufmgr_gem, - AUB_TRACE_MEMTYPE_GTT | ring | AUB_TRACE_OP_COMMAND_WRITE); - aub_out(bufmgr_gem, 0); /* general/surface subtype */ - aub_out(bufmgr_gem, bufmgr_gem->aub_offset); - aub_out(bufmgr_gem, ring_count * 4); - if (bufmgr_gem->gen >= 8) - aub_out(bufmgr_gem, 0); - - /* FIXME: Need some flush operations here? */ - aub_out_data(bufmgr_gem, ringbuffer, ring_count * 4); - - /* Update offset pointer */ - bufmgr_gem->aub_offset += 4096; -} - void drm_intel_gem_bo_aub_dump_bmp(drm_intel_bo *bo, int x1, int y1, int width, int height, enum aub_dump_bmp_format format, int pitch, int offset) { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *)bo; - uint32_t cpp; - - switch (format) { - case AUB_DUMP_BMP_FORMAT_8BIT: - cpp = 1; - break; - case AUB_DUMP_BMP_FORMAT_ARGB_4444: - cpp = 2; - break; - case AUB_DUMP_BMP_FORMAT_ARGB_0888: - case AUB_DUMP_BMP_FORMAT_ARGB_8888: - cpp = 4; - break; - default: - printf("Unknown AUB dump format %d\n", format); - return; - } - - if (!bufmgr_gem->aub_file) - return; - - aub_out(bufmgr_gem, CMD_AUB_DUMP_BMP | 4); - aub_out(bufmgr_gem, (y1 << 16) | x1); - aub_out(bufmgr_gem, - (format << 24) | - (cpp << 19) | - pitch / 4); - aub_out(bufmgr_gem, (height << 16) | width); - aub_out(bufmgr_gem, bo_gem->aub_offset + offset); - aub_out(bufmgr_gem, - ((bo_gem->tiling_mode != I915_TILING_NONE) ? (1 << 2) : 0) | - ((bo_gem->tiling_mode == I915_TILING_Y) ? (1 << 3) : 0)); -} - -static void -aub_exec(drm_intel_bo *bo, int ring_flag, int used) -{ - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr; - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; - int i; - bool batch_buffer_needs_annotations; - - if (!bufmgr_gem->aub_file) - return; - - /* If batch buffer is not annotated, annotate it the best we - * can. - */ - batch_buffer_needs_annotations = bo_gem->aub_annotation_count == 0; - if (batch_buffer_needs_annotations) { - drm_intel_aub_annotation annotations[2] = { - { AUB_TRACE_TYPE_BATCH, 0, used }, - { AUB_TRACE_TYPE_NOTYPE, 0, bo->size } - }; - drm_intel_bufmgr_gem_set_aub_annotations(bo, annotations, 2); - } - - /* Write out all buffers to AUB memory */ - for (i = 0; i < bufmgr_gem->exec_count; i++) { - aub_write_bo(bufmgr_gem->exec_bos[i]); - } - - /* Remove any annotations we added */ - if (batch_buffer_needs_annotations) - drm_intel_bufmgr_gem_set_aub_annotations(bo, NULL, 0); - - /* Dump ring buffer */ - aub_build_dump_ringbuffer(bufmgr_gem, bo_gem->aub_offset, ring_flag); - - fflush(bufmgr_gem->aub_file); - - /* - * One frame has been dumped. So reset the aub_offset for the next frame. - * - * FIXME: Can we do this? - */ - bufmgr_gem->aub_offset = 0x10000; } static int @@ -2533,8 +2235,6 @@ do_exec2(drm_intel_bo *bo, int used, drm_intel_context *ctx, i915_execbuffer2_set_context_id(execbuf, ctx->ctx_id); execbuf.rsvd2 = 0; - aub_exec(bo, flags, used); - if (bufmgr_gem->no_exec) goto skip_execution; @@ -3210,11 +2910,6 @@ void drm_intel_bufmgr_gem_set_aub_filename(drm_intel_bufmgr *bufmgr, const char *filename) { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; - - free(bufmgr_gem->aub_filename); - if (filename) - bufmgr_gem->aub_filename = strdup(filename); } /** @@ -3228,58 +2923,11 @@ drm_intel_bufmgr_gem_set_aub_filename(drm_intel_bufmgr *bufmgr, void drm_intel_bufmgr_gem_set_aub_dump(drm_intel_bufmgr *bufmgr, int enable) { - drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr; - int entry = 0x200003; - int i; - int gtt_size = 0x10000; - const char *filename; - - if (!enable) { - if (bufmgr_gem->aub_file) { - fclose(bufmgr_gem->aub_file); - bufmgr_gem->aub_file = NULL; - } - return; - } - - if (geteuid() != getuid()) - return; - - if (bufmgr_gem->aub_filename) - filename = bufmgr_gem->aub_filename; - else - filename = "intel.aub"; - bufmgr_gem->aub_file = fopen(filename, "w+"); - if (!bufmgr_gem->aub_file) - return; - - /* Start allocating objects from just after the GTT. */ - bufmgr_gem->aub_offset = gtt_size; - - /* Start with a (required) version packet. */ - aub_out(bufmgr_gem, CMD_AUB_HEADER | (13 - 2)); - aub_out(bufmgr_gem, - (4 << AUB_HEADER_MAJOR_SHIFT) | - (0 << AUB_HEADER_MINOR_SHIFT)); - for (i = 0; i < 8; i++) { - aub_out(bufmgr_gem, 0); /* app name */ - } - aub_out(bufmgr_gem, 0); /* timestamp */ - aub_out(bufmgr_gem, 0); /* timestamp */ - aub_out(bufmgr_gem, 0); /* comment len */ - - /* Set up the GTT. The max we can handle is 256M */ - aub_out(bufmgr_gem, CMD_AUB_TRACE_HEADER_BLOCK | ((bufmgr_gem->gen >= 8 ? 6 : 5) - 2)); - /* Need to use GTT_ENTRY type for recent emulator */ - aub_out(bufmgr_gem, AUB_TRACE_MEMTYPE_GTT_ENTRY | 0 | AUB_TRACE_OP_DATA_WRITE); - aub_out(bufmgr_gem, 0); /* subtype */ - aub_out(bufmgr_gem, 0); /* offset */ - aub_out(bufmgr_gem, gtt_size); /* size */ - if (bufmgr_gem->gen >= 8) - aub_out(bufmgr_gem, 0); - for (i = 0x000; i < gtt_size; i += 4, entry += 0x1000) { - aub_out(bufmgr_gem, entry); - } + fprintf(stderr, "libdrm aub dumping is deprecated.\n\n" + "Use intel_aubdump from intel-gpu-tools instead. Install intel-gpu-tools,\n" + "then run (for example)\n\n" + "\t$ intel_aubdump --output=trace.aub glxgears -geometry 500x500\n\n" + "See the intel_aubdump man page for more details.\n"); } drm_intel_context * @@ -3442,19 +3090,6 @@ drm_intel_bufmgr_gem_set_aub_annotations(drm_intel_bo *bo, drm_intel_aub_annotation *annotations, unsigned count) { - drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo; - unsigned size = sizeof(*annotations) * count; - drm_intel_aub_annotation *new_annotations = - count > 0 ? realloc(bo_gem->aub_annotations, size) : NULL; - if (new_annotations == NULL) { - free(bo_gem->aub_annotations); - bo_gem->aub_annotations = NULL; - bo_gem->aub_annotation_count = 0; - return; - } - memcpy(new_annotations, annotations, size); - bo_gem->aub_annotations = new_annotations; - bo_gem->aub_annotation_count = count; } static pthread_mutex_t bufmgr_list_mutex = PTHREAD_MUTEX_INITIALIZER; |
From: <ag...@ke...> - 2015-08-06 15:17:33
|
configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 11a390ea660f95639b2fd2e67f6a9d9042acd467 Author: Alex Deucher <ale...@am...> Date: Thu Aug 6 11:13:48 2015 -0400 fix configuration when amdgpu is disabled Signed-off-by: Alex Deucher <ale...@am...> diff --git a/configure.ac b/configure.ac index 71c45ab..db190eb 100644 --- a/configure.ac +++ b/configure.ac @@ -359,6 +359,7 @@ if test "x$RADEON" = xyes; then AC_DEFINE(HAVE_RADEON, 1, [Have radeon support]) fi +AM_CONDITIONAL(HAVE_CUNIT, [test "x$have_cunit" != "xno"]) AM_CONDITIONAL(HAVE_AMDGPU, [test "x$AMDGPU" = xyes]) if test "x$AMDGPU" = xyes; then AC_DEFINE(HAVE_AMDGPU, 1, [Have amdgpu support]) @@ -378,7 +379,6 @@ if test "x$AMDGPU" = xyes; then fi fi - AM_CONDITIONAL(HAVE_CUNIT, [test "x$have_cunit" != "xno"]) AC_DEFINE(HAVE_CUNIT, [test "x$have_cunit" != "xno"], [Enable CUNIT Have amdgpu support]) if test "x$have_cunit" = "xno"; then |
From: <ag...@ke...> - 2015-08-06 15:21:50
|
configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit b93594b1bfc48250e95ad1d7e09d53b7b1a8ffac Author: Alex Deucher <ale...@am...> Date: Thu Aug 6 11:19:55 2015 -0400 fix amdgpu cunit configure test harder Signed-off-by: Alex Deucher <ale...@am...> diff --git a/configure.ac b/configure.ac index db190eb..f2e1150 100644 --- a/configure.ac +++ b/configure.ac @@ -359,13 +359,14 @@ if test "x$RADEON" = xyes; then AC_DEFINE(HAVE_RADEON, 1, [Have radeon support]) fi +# Detect cunit library +PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no]) AM_CONDITIONAL(HAVE_CUNIT, [test "x$have_cunit" != "xno"]) + AM_CONDITIONAL(HAVE_AMDGPU, [test "x$AMDGPU" = xyes]) if test "x$AMDGPU" = xyes; then AC_DEFINE(HAVE_AMDGPU, 1, [Have amdgpu support]) - # Detect cunit library - PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no]) # If pkg-config does not find cunit, check it using AC_CHECK_LIB. We # do this because Debian (Ubuntu) lacks pkg-config file for cunit. |
From: <ag...@ke...> - 2015-08-06 17:40:50
|
configure.ac | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) New commits: commit e1f31d98a771244c026094584c96e9b86bcab825 Author: Alex Deucher <ale...@am...> Date: Thu Aug 6 13:38:31 2015 -0400 move up cunit workaround for ubuntu/debian Signed-off-by: Alex Deucher <ale...@am...> diff --git a/configure.ac b/configure.ac index f2e1150..41bf039 100644 --- a/configure.ac +++ b/configure.ac @@ -361,25 +361,23 @@ fi # Detect cunit library PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no]) +# If pkg-config does not find cunit, check it using AC_CHECK_LIB. We +# do this because Debian (Ubuntu) lacks pkg-config file for cunit. +if test "x${have_cunit}" = "xno"; then + AC_CHECK_LIB([cunit], [CU_initialize_registry], [have_cunit=yes], [have_cunit=no]) + if test "x${have_cunit}" = "xyes"; then + CUNIT_LIBS="-lcunit" + CUNIT_CFLAGS="" + AC_SUBST([CUNIT_LIBS]) + AC_SUBST([CUNIT_CFLAGS]) + fi +fi AM_CONDITIONAL(HAVE_CUNIT, [test "x$have_cunit" != "xno"]) AM_CONDITIONAL(HAVE_AMDGPU, [test "x$AMDGPU" = xyes]) if test "x$AMDGPU" = xyes; then AC_DEFINE(HAVE_AMDGPU, 1, [Have amdgpu support]) - - # If pkg-config does not find cunit, check it using AC_CHECK_LIB. We - # do this because Debian (Ubuntu) lacks pkg-config file for cunit. - if test "x${have_cunit}" = "xno"; then - AC_CHECK_LIB([cunit], [CU_initialize_registry], [have_cunit=yes], [have_cunit=no]) - if test "x${have_cunit}" = "xyes"; then - CUNIT_LIBS="-lcunit" - CUNIT_CFLAGS="" - AC_SUBST([CUNIT_LIBS]) - AC_SUBST([CUNIT_CFLAGS]) - fi - fi - AC_DEFINE(HAVE_CUNIT, [test "x$have_cunit" != "xno"], [Enable CUNIT Have amdgpu support]) if test "x$have_cunit" = "xno"; then |
From: <ag...@ke...> - 2015-08-06 17:45:35
|
configure.ac | 1 + 1 file changed, 1 insertion(+) New commits: commit c8df9e724e9a2559d551fa93f13afe7084b6af3f Author: Alex Deucher <ale...@am...> Date: Thu Aug 6 13:44:16 2015 -0400 add a note about which version of cunit is fixed for debian/ubuntu Signed-off-by: Alex Deucher <ale...@am...> diff --git a/configure.ac b/configure.ac index 41bf039..81e0f80 100644 --- a/configure.ac +++ b/configure.ac @@ -363,6 +363,7 @@ fi PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no]) # If pkg-config does not find cunit, check it using AC_CHECK_LIB. We # do this because Debian (Ubuntu) lacks pkg-config file for cunit. +# fixed in 2.1-2.dfsg-3: http://anonscm.debian.org/cgit/collab-maint/cunit.git/commit/?h=debian if test "x${have_cunit}" = "xno"; then AC_CHECK_LIB([cunit], [CU_initialize_registry], [have_cunit=yes], [have_cunit=no]) if test "x${have_cunit}" = "xyes"; then |