diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2010-09-26 07:47:25 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-10-05 21:50:31 -0400 |
commit | 413d45d3627be4748058dea697718ed6fb88bd01 (patch) | |
tree | 038e5d5e80eefbb5d9771c489460653c6ef3cf79 /drivers/gpu | |
parent | be64c2bb4731b0e6223a496eed615b816ac879ec (diff) |
drm, kdb, kms: Add an enter argument to mode_set_base_atomic() API
Some devices such as the radeon chips receive information from user
space which needs to be saved when executing an atomic mode set
operation, else the user space would have to be queried again for the
information.
This patch extends the mode_set_base_atomic() call to pass an argument
to indicate if this is an entry or an exit from an atomic kernel mode
set change. Individual drm drivers can properly save and restore
state accordingly.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
CC: Jesse Barnes <jbarnes@virtuousgeek.org>
CC: David Airlie <airlied@linux.ie>
CC: dri-devel@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/drm_fb_helper.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv04_crtc.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_crtc.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_crtc.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mode.h | 4 |
7 files changed, 11 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 6a5e403f9aa1..625a2d551d6a 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
@@ -263,7 +263,8 @@ int drm_fb_helper_debug_enter(struct fb_info *info) | |||
263 | funcs->mode_set_base_atomic(mode_set->crtc, | 263 | funcs->mode_set_base_atomic(mode_set->crtc, |
264 | mode_set->fb, | 264 | mode_set->fb, |
265 | mode_set->x, | 265 | mode_set->x, |
266 | mode_set->y); | 266 | mode_set->y, |
267 | 1); | ||
267 | 268 | ||
268 | } | 269 | } |
269 | } | 270 | } |
@@ -309,7 +310,7 @@ int drm_fb_helper_debug_leave(struct fb_info *info) | |||
309 | } | 310 | } |
310 | 311 | ||
311 | funcs->mode_set_base_atomic(mode_set->crtc, fb, crtc->x, | 312 | funcs->mode_set_base_atomic(mode_set->crtc, fb, crtc->x, |
312 | crtc->y); | 313 | crtc->y, 0); |
313 | } | 314 | } |
314 | 315 | ||
315 | return 0; | 316 | return 0; |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 69c54c5a4254..9109c00f3ead 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -1492,7 +1492,7 @@ err_unpin: | |||
1492 | /* Assume fb object is pinned & idle & fenced and just update base pointers */ | 1492 | /* Assume fb object is pinned & idle & fenced and just update base pointers */ |
1493 | static int | 1493 | static int |
1494 | intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb, | 1494 | intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb, |
1495 | int x, int y) | 1495 | int x, int y, int enter) |
1496 | { | 1496 | { |
1497 | struct drm_device *dev = crtc->dev; | 1497 | struct drm_device *dev = crtc->dev; |
1498 | struct drm_i915_private *dev_priv = dev->dev_private; | 1498 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -1614,7 +1614,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
1614 | atomic_read(&obj_priv->pending_flip) == 0); | 1614 | atomic_read(&obj_priv->pending_flip) == 0); |
1615 | } | 1615 | } |
1616 | 1616 | ||
1617 | ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y); | 1617 | ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y, 0); |
1618 | if (ret) { | 1618 | if (ret) { |
1619 | i915_gem_object_unpin(to_intel_framebuffer(crtc->fb)->obj); | 1619 | i915_gem_object_unpin(to_intel_framebuffer(crtc->fb)->obj); |
1620 | mutex_unlock(&dev->struct_mutex); | 1620 | mutex_unlock(&dev->struct_mutex); |
diff --git a/drivers/gpu/drm/nouveau/nv04_crtc.c b/drivers/gpu/drm/nouveau/nv04_crtc.c index f5bbd46f76bc..fb669dd39c3c 100644 --- a/drivers/gpu/drm/nouveau/nv04_crtc.c +++ b/drivers/gpu/drm/nouveau/nv04_crtc.c | |||
@@ -858,7 +858,7 @@ nv04_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, | |||
858 | static int | 858 | static int |
859 | nv04_crtc_mode_set_base_atomic(struct drm_crtc *crtc, | 859 | nv04_crtc_mode_set_base_atomic(struct drm_crtc *crtc, |
860 | struct drm_framebuffer *fb, | 860 | struct drm_framebuffer *fb, |
861 | int x, int y) | 861 | int x, int y, int enter) |
862 | { | 862 | { |
863 | return nv04_crtc_do_mode_set_base(crtc, fb, x, y, true); | 863 | return nv04_crtc_do_mode_set_base(crtc, fb, x, y, true); |
864 | } | 864 | } |
diff --git a/drivers/gpu/drm/nouveau/nv50_crtc.c b/drivers/gpu/drm/nouveau/nv50_crtc.c index f41b44864e80..727a7a12fed9 100644 --- a/drivers/gpu/drm/nouveau/nv50_crtc.c +++ b/drivers/gpu/drm/nouveau/nv50_crtc.c | |||
@@ -712,7 +712,7 @@ nv50_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, | |||
712 | static int | 712 | static int |
713 | nv50_crtc_mode_set_base_atomic(struct drm_crtc *crtc, | 713 | nv50_crtc_mode_set_base_atomic(struct drm_crtc *crtc, |
714 | struct drm_framebuffer *fb, | 714 | struct drm_framebuffer *fb, |
715 | int x, int y) | 715 | int x, int y, int enter) |
716 | { | 716 | { |
717 | return nv50_crtc_do_mode_set_base(crtc, fb, x, y, true, true); | 717 | return nv50_crtc_do_mode_set_base(crtc, fb, x, y, true, true); |
718 | } | 718 | } |
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 2ab9b360d3c9..501e5286ec3f 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
@@ -1180,7 +1180,7 @@ int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y, | |||
1180 | 1180 | ||
1181 | int atombios_crtc_set_base_atomic(struct drm_crtc *crtc, | 1181 | int atombios_crtc_set_base_atomic(struct drm_crtc *crtc, |
1182 | struct drm_framebuffer *fb, | 1182 | struct drm_framebuffer *fb, |
1183 | int x, int y) | 1183 | int x, int y, int enter) |
1184 | { | 1184 | { |
1185 | struct drm_device *dev = crtc->dev; | 1185 | struct drm_device *dev = crtc->dev; |
1186 | struct radeon_device *rdev = dev->dev_private; | 1186 | struct radeon_device *rdev = dev->dev_private; |
diff --git a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c index bfa090e1f512..8752d3447b72 100644 --- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c +++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c | |||
@@ -353,7 +353,7 @@ int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y, | |||
353 | 353 | ||
354 | int radeon_crtc_set_base_atomic(struct drm_crtc *crtc, | 354 | int radeon_crtc_set_base_atomic(struct drm_crtc *crtc, |
355 | struct drm_framebuffer *fb, | 355 | struct drm_framebuffer *fb, |
356 | int x, int y) | 356 | int x, int y, int enter) |
357 | { | 357 | { |
358 | return radeon_crtc_do_set_base(crtc, fb, x, y, 1); | 358 | return radeon_crtc_do_set_base(crtc, fb, x, y, 1); |
359 | } | 359 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index 9dd27c23a798..c4116d3d8d06 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
@@ -516,7 +516,7 @@ extern int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y, | |||
516 | struct drm_framebuffer *old_fb); | 516 | struct drm_framebuffer *old_fb); |
517 | extern int atombios_crtc_set_base_atomic(struct drm_crtc *crtc, | 517 | extern int atombios_crtc_set_base_atomic(struct drm_crtc *crtc, |
518 | struct drm_framebuffer *fb, | 518 | struct drm_framebuffer *fb, |
519 | int x, int y); | 519 | int x, int y, int enter); |
520 | extern int atombios_crtc_mode_set(struct drm_crtc *crtc, | 520 | extern int atombios_crtc_mode_set(struct drm_crtc *crtc, |
521 | struct drm_display_mode *mode, | 521 | struct drm_display_mode *mode, |
522 | struct drm_display_mode *adjusted_mode, | 522 | struct drm_display_mode *adjusted_mode, |
@@ -528,7 +528,7 @@ extern int radeon_crtc_set_base(struct drm_crtc *crtc, int x, int y, | |||
528 | struct drm_framebuffer *old_fb); | 528 | struct drm_framebuffer *old_fb); |
529 | extern int radeon_crtc_set_base_atomic(struct drm_crtc *crtc, | 529 | extern int radeon_crtc_set_base_atomic(struct drm_crtc *crtc, |
530 | struct drm_framebuffer *fb, | 530 | struct drm_framebuffer *fb, |
531 | int x, int y); | 531 | int x, int y, int enter); |
532 | extern int radeon_crtc_do_set_base(struct drm_crtc *crtc, | 532 | extern int radeon_crtc_do_set_base(struct drm_crtc *crtc, |
533 | struct drm_framebuffer *fb, | 533 | struct drm_framebuffer *fb, |
534 | int x, int y, int atomic); | 534 | int x, int y, int atomic); |