diff options
author | Dave Airlie <airlied@redhat.com> | 2012-01-05 04:55:22 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-01-06 05:01:35 -0500 |
commit | cc1f71942944890c7e05fc55dc4427c94b63d4f1 (patch) | |
tree | 2e9e1b347adb6e4457a02da6e5c2fcbdda851a28 /drivers/gpu/drm/radeon/atom.c | |
parent | 3df96909b75835d487a9178761622b0cbd7310d4 (diff) |
drm: introduce drm_can_sleep and use in intel/radeon drivers. (v2)
So we have a few places where the drm drivers would like to sleep to
be nice to the system, mainly in the modesetting paths, but we also
have two cases were atomic modesetting must take place, panic writing
and kernel debugger. So provide a central inline to determine if a
sleep or delay should be used and use this in the intel and radeon drivers.
v2: drop intel_drv.h MSLEEP macro, nobody uses it.
Based on patch from Michel Dänzer <michel.daenzer@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43941
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/atom.c')
-rw-r--r-- | drivers/gpu/drm/radeon/atom.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index 14cc88aaf3a7..d1bd239cd9e9 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c | |||
@@ -665,6 +665,8 @@ static void atom_op_delay(atom_exec_context *ctx, int *ptr, int arg) | |||
665 | SDEBUG(" count: %d\n", count); | 665 | SDEBUG(" count: %d\n", count); |
666 | if (arg == ATOM_UNIT_MICROSEC) | 666 | if (arg == ATOM_UNIT_MICROSEC) |
667 | udelay(count); | 667 | udelay(count); |
668 | else if (!drm_can_sleep()) | ||
669 | mdelay(count); | ||
668 | else | 670 | else |
669 | msleep(count); | 671 | msleep(count); |
670 | } | 672 | } |