Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206250
b: refs/heads/master
c: 991ea75
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Jul 22, 2010
1 parent fd638aa commit 943e415
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 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: 9b646972467fb5fdc677f9e4251875db20bdbb64
refs/heads/master: 991ea75cb1df7188d209274b3d51c105b4f18ffe
29 changes: 10 additions & 19 deletions trunk/drivers/gpu/drm/drm_crtc_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,13 +808,11 @@ int drm_helper_resume_force_mode(struct drm_device *dev)
}
EXPORT_SYMBOL(drm_helper_resume_force_mode);

static struct slow_work_ops output_poll_ops;

#define DRM_OUTPUT_POLL_PERIOD (10*HZ)
static void output_poll_execute(struct slow_work *work)
static void output_poll_execute(struct work_struct *work)
{
struct delayed_slow_work *delayed_work = container_of(work, struct delayed_slow_work, work);
struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_slow_work);
struct delayed_work *delayed_work = to_delayed_work(work);
struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_work);
struct drm_connector *connector;
enum drm_connector_status old_status, status;
bool repoll = false, changed = false;
Expand Down Expand Up @@ -854,7 +852,7 @@ static void output_poll_execute(struct slow_work *work)
}

if (repoll) {
ret = delayed_slow_work_enqueue(delayed_work, DRM_OUTPUT_POLL_PERIOD);
ret = queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD);
if (ret)
DRM_ERROR("delayed enqueue failed %d\n", ret);
}
Expand All @@ -864,7 +862,7 @@ void drm_kms_helper_poll_disable(struct drm_device *dev)
{
if (!dev->mode_config.poll_enabled)
return;
delayed_slow_work_cancel(&dev->mode_config.output_poll_slow_work);
cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
}
EXPORT_SYMBOL(drm_kms_helper_poll_disable);

Expand All @@ -880,7 +878,7 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
}

if (poll) {
ret = delayed_slow_work_enqueue(&dev->mode_config.output_poll_slow_work, DRM_OUTPUT_POLL_PERIOD);
ret = queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD);
if (ret)
DRM_ERROR("delayed enqueue failed %d\n", ret);
}
Expand All @@ -889,9 +887,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_enable);

void drm_kms_helper_poll_init(struct drm_device *dev)
{
slow_work_register_user(THIS_MODULE);
delayed_slow_work_init(&dev->mode_config.output_poll_slow_work,
&output_poll_ops);
INIT_DELAYED_WORK(&dev->mode_config.output_poll_work, output_poll_execute);
dev->mode_config.poll_enabled = true;

drm_kms_helper_poll_enable(dev);
Expand All @@ -901,20 +897,15 @@ EXPORT_SYMBOL(drm_kms_helper_poll_init);
void drm_kms_helper_poll_fini(struct drm_device *dev)
{
drm_kms_helper_poll_disable(dev);
slow_work_unregister_user(THIS_MODULE);
}
EXPORT_SYMBOL(drm_kms_helper_poll_fini);

void drm_helper_hpd_irq_event(struct drm_device *dev)
{
if (!dev->mode_config.poll_enabled)
return;
delayed_slow_work_cancel(&dev->mode_config.output_poll_slow_work);
/* schedule a slow work asap */
delayed_slow_work_enqueue(&dev->mode_config.output_poll_slow_work, 0);
/* kill timer and schedule immediate execution, this doesn't block */
cancel_delayed_work(&dev->mode_config.output_poll_work);
queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, 0);
}
EXPORT_SYMBOL(drm_helper_hpd_irq_event);

static struct slow_work_ops output_poll_ops = {
.execute = output_poll_execute,
};
3 changes: 1 addition & 2 deletions trunk/include/drm/drm_crtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <linux/idr.h>

#include <linux/fb.h>
#include <linux/slow-work.h>

struct drm_device;
struct drm_mode_set;
Expand Down Expand Up @@ -595,7 +594,7 @@ struct drm_mode_config {

/* output poll support */
bool poll_enabled;
struct delayed_slow_work output_poll_slow_work;
struct delayed_work output_poll_work;

/* pointers to standard properties */
struct list_head property_blob_list;
Expand Down

0 comments on commit 943e415

Please sign in to comment.