- pull in radeon bo busy
This commit is contained in:
parent
27a6d0b528
commit
ab6c6b64a1
@ -108,16 +108,15 @@ diff --git a/shared-core/drm.h b/shared-core/drm.h
|
||||
index 97fab9a..8b504cb 100644
|
||||
--- a/shared-core/drm.h
|
||||
+++ b/shared-core/drm.h
|
||||
@@ -1113,7 +1113,7 @@ struct drm_gem_open {
|
||||
@@ -1113,6 +1113,7 @@ struct drm_gem_open {
|
||||
#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
|
||||
#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
|
||||
#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, uint32_t)
|
||||
-#define DRM_IOCTL_MODE_REPLACEFB DRM_IOWR(0xB0, struct drm_mode_fb_cmd)
|
||||
+#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOW( 0xB0, struct drm_mode_page_flip)
|
||||
|
||||
/*@}*/
|
||||
|
||||
@@ -1128,6 +1128,30 @@ struct drm_gem_open {
|
||||
@@ -1128,6 +1129,30 @@ struct drm_gem_open {
|
||||
#define DRM_COMMAND_BASE 0x40
|
||||
#define DRM_COMMAND_END 0xA0
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
Summary: Direct Rendering Manager runtime library
|
||||
Name: libdrm
|
||||
Version: 2.4.12
|
||||
Release: 0.8%{?dist}
|
||||
Release: 0.9%{?dist}
|
||||
License: MIT
|
||||
Group: System Environment/Libraries
|
||||
URL: http://dri.sourceforge.net
|
||||
@ -22,6 +22,7 @@ BuildRequires: libudev-devel
|
||||
|
||||
Source2: 91-drm-modeset.rules
|
||||
|
||||
Patch2: radeon-busy.patch
|
||||
# hardcode the 666 instead of 660 for device nodes
|
||||
Patch3: libdrm-make-dri-perms-okay.patch
|
||||
# remove backwards compat not needed on Fedora
|
||||
@ -29,6 +30,7 @@ Patch4: libdrm-2.4.0-no-bc.patch
|
||||
|
||||
Patch5: libdrm-page-flip.patch
|
||||
|
||||
|
||||
%description
|
||||
Direct Rendering Manager runtime library
|
||||
|
||||
@ -44,6 +46,7 @@ Direct Rendering Manager development package
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{gitdate}
|
||||
%patch2 -p1 -b .radeon-busy
|
||||
%patch3 -p1 -b .forceperms
|
||||
%patch4 -p1 -b .no-bc
|
||||
%patch5 -p1 -b .page-flip
|
||||
@ -106,6 +109,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_libdir}/pkgconfig/libdrm_nouveau.pc
|
||||
|
||||
%changelog
|
||||
* Wed Aug 26 2009 Dave Airlie <airlied@redhat.com> 2.4.12-0.9
|
||||
- pull in radeon bo busy
|
||||
|
||||
* Thu Aug 20 2009 Ben Skeggs <bskeggs@redhat.com> 2.4.12-0.8
|
||||
- rebase to new libdrm snapshot
|
||||
|
||||
|
127
radeon-busy.patch
Normal file
127
radeon-busy.patch
Normal file
@ -0,0 +1,127 @@
|
||||
diff --git a/libdrm/radeon/radeon_bo.h b/libdrm/radeon/radeon_bo.h
|
||||
index 09ad068..1e2e6c2 100644
|
||||
--- a/libdrm/radeon/radeon_bo.h
|
||||
+++ b/libdrm/radeon/radeon_bo.h
|
||||
@@ -73,6 +73,7 @@ struct radeon_bo_funcs {
|
||||
uint32_t pitch);
|
||||
int (*bo_get_tiling)(struct radeon_bo *bo, uint32_t *tiling_flags,
|
||||
uint32_t *pitch);
|
||||
+ int (*bo_is_busy)(struct radeon_bo *bo, uint32_t *domain);
|
||||
};
|
||||
|
||||
struct radeon_bo_manager {
|
||||
@@ -166,6 +167,15 @@ static inline int _radeon_bo_wait(struct radeon_bo *bo,
|
||||
return bo->bom->funcs->bo_wait(bo);
|
||||
}
|
||||
|
||||
+static inline int _radeon_bo_is_busy(struct radeon_bo *bo,
|
||||
+ uint32_t *domain,
|
||||
+ const char *file,
|
||||
+ const char *func,
|
||||
+ int line)
|
||||
+{
|
||||
+ return bo->bom->funcs->bo_is_busy(bo, domain);
|
||||
+}
|
||||
+
|
||||
static inline int radeon_bo_set_tiling(struct radeon_bo *bo,
|
||||
uint32_t tiling_flags, uint32_t pitch)
|
||||
{
|
||||
@@ -199,5 +209,7 @@ static inline int radeon_bo_is_static(struct radeon_bo *bo)
|
||||
_radeon_bo_debug(bo, opcode, __FILE__, __FUNCTION__, __LINE__)
|
||||
#define radeon_bo_wait(bo) \
|
||||
_radeon_bo_wait(bo, __FILE__, __func__, __LINE__)
|
||||
+#define radeon_bo_is_busy(bo, domain) \
|
||||
+ _radeon_bo_is_busy(bo, domain, __FILE__, __func__, __LINE__)
|
||||
|
||||
#endif
|
||||
diff --git a/libdrm/radeon/radeon_bo_gem.c b/libdrm/radeon/radeon_bo_gem.c
|
||||
index cf59a35..76d80e7 100644
|
||||
--- a/libdrm/radeon/radeon_bo_gem.c
|
||||
+++ b/libdrm/radeon/radeon_bo_gem.c
|
||||
@@ -209,6 +209,21 @@ static int bo_wait(struct radeon_bo *bo)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static int bo_is_busy(struct radeon_bo *bo, uint32_t *domain)
|
||||
+{
|
||||
+ struct drm_radeon_gem_busy args;
|
||||
+ int ret;
|
||||
+
|
||||
+ args.handle = bo->handle;
|
||||
+ args.domain = 0;
|
||||
+
|
||||
+ ret = drmCommandWriteRead(bo->bom->fd, DRM_RADEON_GEM_BUSY,
|
||||
+ &args, sizeof(args));
|
||||
+
|
||||
+ *domain = args.domain;
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static int bo_set_tiling(struct radeon_bo *bo, uint32_t tiling_flags,
|
||||
uint32_t pitch)
|
||||
{
|
||||
@@ -257,6 +272,7 @@ static struct radeon_bo_funcs bo_gem_funcs = {
|
||||
NULL,
|
||||
bo_set_tiling,
|
||||
bo_get_tiling,
|
||||
+ bo_is_busy,
|
||||
};
|
||||
|
||||
struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd)
|
||||
diff --git a/shared-core/drm.h b/shared-core/drm.h
|
||||
index 42a6c23..d97844f 100644
|
||||
--- a/shared-core/drm.h
|
||||
+++ b/shared-core/drm.h
|
||||
@@ -795,7 +795,6 @@ struct drm_gem_open {
|
||||
#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
|
||||
#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
|
||||
#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, uint32_t)
|
||||
-#define DRM_IOCTL_MODE_REPLACEFB DRM_IOWR(0xB0, struct drm_mode_fb_cmd)
|
||||
|
||||
/*@}*/
|
||||
|
||||
diff --git a/shared-core/radeon_drm.h b/shared-core/radeon_drm.h
|
||||
index 3745ac5..47f1952 100644
|
||||
--- a/shared-core/radeon_drm.h
|
||||
+++ b/shared-core/radeon_drm.h
|
||||
@@ -505,6 +505,7 @@ typedef struct {
|
||||
#define DRM_RADEON_INFO 0x27
|
||||
#define DRM_RADEON_GEM_SET_TILING 0x28
|
||||
#define DRM_RADEON_GEM_GET_TILING 0x29
|
||||
+#define DRM_RADEON_GEM_BUSY 0x2a
|
||||
|
||||
#define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t)
|
||||
#define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START)
|
||||
@@ -545,6 +546,7 @@ typedef struct {
|
||||
#define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info)
|
||||
#define DRM_IOCTL_RADEON_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling)
|
||||
#define DRM_IOCTL_RADEON_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling)
|
||||
+#define DRM_IOCTL_RADEON_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_BUSY, struct drm_radeon_gem_busy)
|
||||
|
||||
typedef struct drm_radeon_init {
|
||||
enum {
|
||||
@@ -704,6 +706,7 @@ typedef struct drm_radeon_indirect {
|
||||
#define RADEON_PARAM_FB_LOCATION 14 /* FB location */
|
||||
#define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */
|
||||
#define RADEON_PARAM_DEVICE_ID 16
|
||||
+#define RADEON_PARAM_NUM_Z_PIPES 17 /* num Z pipes */
|
||||
|
||||
typedef struct drm_radeon_getparam {
|
||||
int param;
|
||||
@@ -835,7 +838,7 @@ struct drm_radeon_gem_wait_idle {
|
||||
|
||||
struct drm_radeon_gem_busy {
|
||||
uint32_t handle;
|
||||
- uint32_t busy;
|
||||
+ uint32_t domain;
|
||||
};
|
||||
|
||||
struct drm_radeon_gem_pread {
|
||||
@@ -892,6 +895,7 @@ struct drm_radeon_cs {
|
||||
|
||||
#define RADEON_INFO_DEVICE_ID 0x00
|
||||
#define RADEON_INFO_NUM_GB_PIPES 0x01
|
||||
+#define RADEON_INFO_NUM_Z_PIPES 0x02
|
||||
|
||||
struct drm_radeon_info {
|
||||
uint32_t request;
|
Loading…
Reference in New Issue
Block a user