Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282738
b: refs/heads/master
c: cc1f719
h: refs/heads/master
v: v3
  • Loading branch information
Dave Airlie committed Jan 6, 2012
1 parent 0b233fa commit e277826
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3df96909b75835d487a9178761622b0cbd7310d4
refs/heads/master: cc1f71942944890c7e05fc55dc4427c94b63d4f1
9 changes: 1 addition & 8 deletions trunk/drivers/gpu/drm/i915/intel_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,14 @@
ret__ = -ETIMEDOUT; \
break; \
} \
if (W && !(in_atomic() || in_dbg_master())) msleep(W); \
if (W && drm_can_sleep()) msleep(W); \
} \
ret__; \
})

#define wait_for(COND, MS) _wait_for(COND, MS, 1)
#define wait_for_atomic(COND, MS) _wait_for(COND, MS, 0)

#define MSLEEP(x) do { \
if (in_dbg_master()) \
mdelay(x); \
else \
msleep(x); \
} while (0)

#define KHz(x) (1000*x)
#define MHz(x) KHz(1000*x)

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/gpu/drm/radeon/atom.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,8 @@ static void atom_op_delay(atom_exec_context *ctx, int *ptr, int arg)
SDEBUG(" count: %d\n", count);
if (arg == ATOM_UNIT_MICROSEC)
udelay(count);
else if (!drm_can_sleep())
mdelay(count);
else
msleep(count);
}
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -1696,5 +1696,13 @@ extern void drm_platform_exit(struct drm_driver *driver, struct platform_device
extern int drm_get_platform_dev(struct platform_device *pdev,
struct drm_driver *driver);

/* returns true if currently okay to sleep */
static __inline__ bool drm_can_sleep(void)
{
if (in_atomic() || in_dbg_master() || irqs_disabled())
return false;
return true;
}

#endif /* __KERNEL__ */
#endif

0 comments on commit e277826

Please sign in to comment.