Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/dist/drm/radeon Don't reserve if atomi...
details: https://anonhg.NetBSD.org/src/rev/f7d780c61f20
branches: trunk
changeset: 337237:f7d780c61f20
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Apr 08 01:42:40 2015 +0000
description:
Don't reserve if atomic -- caller must have pre-pinned the buffer.
diffstat:
sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c | 17 +++++++------
sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c | 13 +++++++++-
2 files changed, 21 insertions(+), 9 deletions(-)
diffs (73 lines):
diff -r f178756b9234 -r f7d780c61f20 sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c Tue Apr 07 23:30:36 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/atombios_crtc.c Wed Apr 08 01:42:40 2015 +0000
@@ -1124,23 +1124,24 @@
*/
obj = radeon_fb->obj;
rbo = gem_to_radeon_bo(obj);
- r = radeon_bo_reserve(rbo, false);
- if (unlikely(r != 0))
- return r;
- if (atomic)
+ if (atomic) {
+ BUG_ON(rbo->pin_count == 0);
fb_location = radeon_bo_gpu_offset(rbo);
- else {
+ tiling_flags = 0;
+ } else {
+ r = radeon_bo_reserve(rbo, false);
+ if (unlikely(r != 0))
+ return r;
r = radeon_bo_pin(rbo, RADEON_GEM_DOMAIN_VRAM, &fb_location);
if (unlikely(r != 0)) {
radeon_bo_unreserve(rbo);
return -EINVAL;
}
+ radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL);
+ radeon_bo_unreserve(rbo);
}
- radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL);
- radeon_bo_unreserve(rbo);
-
switch (target_fb->bits_per_pixel) {
case 8:
fb_format = (EVERGREEN_GRPH_DEPTH(EVERGREEN_GRPH_DEPTH_8BPP) |
diff -r f178756b9234 -r f7d780c61f20 sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c Tue Apr 07 23:30:36 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_legacy_crtc.c Wed Apr 08 01:42:40 2015 +0000
@@ -422,6 +422,16 @@
/* Pin framebuffer & get tilling informations */
obj = radeon_fb->obj;
rbo = gem_to_radeon_bo(obj);
+ if (atomic) {
+ /*
+ * If you want to do this in atomic, better have it
+ * pinned ahead of time.
+ */
+ BUG_ON(rbo->pin_count == 0);
+ base = radeon_bo_gpu_offset(rbo);
+ tiling_flags = 0;
+ goto pinned;
+ }
retry:
r = radeon_bo_reserve(rbo, false);
if (unlikely(r != 0))
@@ -444,7 +454,7 @@
* We don't shutdown the display controller because new buffer
* will end up in same spot.
*/
- if (!atomic && fb && fb != crtc->primary->fb) {
+ if (fb && fb != crtc->primary->fb) {
struct radeon_bo *old_rbo;
unsigned long nsize, osize;
@@ -462,6 +472,7 @@
}
radeon_bo_get_tiling_flags(rbo, &tiling_flags, NULL);
radeon_bo_unreserve(rbo);
+pinned:
if (tiling_flags & RADEON_TILING_MICRO)
DRM_ERROR("trying to scanout microtiled buffer\n");
Home |
Main Index |
Thread Index |
Old Index