intel_fb: enable polling for connector changes

To circumvent problems on platforms with shaky hotplug interrupt notification
introduce a "poll" configuration option to the driver, which enables
polling for connector changes.

Fix #2004
This commit is contained in:
Stefan Kalkowski
2016-06-09 12:00:59 +02:00
committed by Christian Helmuth
parent 11bead1811
commit 0c13effaa8
6 changed files with 91 additions and 38 deletions

View File

@ -96,18 +96,7 @@ class Lx_kit::Irq : public Lx::Irq
Lx_kit::List<Handler> _handler;
Lx::Task _task;
Genode::Signal_rpc_member<Context> _dispatcher;
/**
* Signal handler
*/
void _handle(unsigned)
{
_task.unblock();
/* kick off scheduling */
Lx::scheduler().schedule();
}
Genode::Signal_handler<Context> _dispatcher;
static void _run_irq(void *args)
{
@ -131,7 +120,7 @@ class Lx_kit::Irq : public Lx::Irq
_dev(dev),
_irq_sess(dev.irq(0)),
_task(_run_irq, this, _name.name, Lx::Task::PRIORITY_3, Lx::scheduler()),
_dispatcher(ep, *this, &Context::_handle)
_dispatcher(ep, *this, &Context::unblock)
{
_irq_sess.sigh(_dispatcher);
@ -139,6 +128,17 @@ class Lx_kit::Irq : public Lx::Irq
_irq_sess.ack_irq();
}
/**
* Unblock this context, e.g., as result of an IRQ signal
*/
void unblock()
{
_task.unblock();
/* kick off scheduling */
Lx::scheduler().schedule();
}
/**
* Handle IRQ
*/
@ -214,6 +214,12 @@ class Lx_kit::Irq : public Lx::Irq
Handler(dev_id, handler, thread_fn);
ctx->add_handler(h);
}
void inject_irq(Platform::Device &dev)
{
Context *ctx = _find_context(dev);
if (ctx) ctx->unblock();
}
};