kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: FW: wrapper device driver
Date: Tue, 3 Feb 2015 12:18:41 -0800	[thread overview]
Message-ID: <20150203201841.GB5267@kroah.com> (raw)
In-Reply-To: <CALRD3qJcHc0h=bk7ZgBDbOUnVjfMNHL6BXEcPqNgMTQAs4Tnyw@mail.gmail.com>

On Tue, Feb 03, 2015 at 09:34:31AM -0600, riya khanna wrote:
> > You didn't answer my question of "which specific devices do you care
> > about" :(
> >
> > You can't "filter" device commands (see the before-mentioned cdrom mess,
> > you have learned from history, right?)  And you can't assume you know
> > what the in-kernel state of devices really are, as they are getting
> > commands from the hardware itself that changes this state, not all
> > changes come from userspace.
> >
> 
> Thanks for the explanation and sorry for not answering your question.
> I care about input and graphics subsystem (no specific device) because
> there are abstractions already available in the kernel for them (e.g.
> evdev, drm kms). I'm not talking about filtering device-specific
> commands through ioctl(). I understand the problem with that. However,
> I was wondering if one could take advantage of generic interfaces
> (e.g. evdev) and mediate accesses in user space through ioctl.

You have looked at the bazillion different DRM ioctls, right?  And
understand the state machine complexities that happen between the kernel
and userspace for a DRM device?  Have you written up how you would
handle mediating that interface in a reasonable manner?

> For
> example, if a container is in the background (i.e. user not
> interacting with it), then all inputs should be blocked to it, but if
> it becomes active again inputs must be redirected to its virtual
> devices.

That seems foolish, what happens if that background container tried to
set the state of a specific device?  How can you reliably fail that?

> This can be done through evdev interface's EVIOCGRAB and
> EVIOCREVOKE ioctls.

evdev already gives you all the needed hooks to try to do something like
this from userspace.  There shouldn't need to be anything extra to do
here, otherwise, how would input devices work today in multi-session
systems?

I would go back and talk to who ever is thinking that they want this
type of solution, to just sit down and look at the DRM ioctl interface.
After they are done screaming, you shouldn't have to worry about being
given impossible tasks anymore :)

Best of luck,

greg k-h

  parent reply	other threads:[~2015-02-03 20:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02 21:24 wrapper device driver riya khanna
     [not found] ` <4796D93DD200E1498C487662EAD9C0DD11A5969F@MBXP14.ds.man.ac.uk>
2015-02-02 21:44   ` FW: " Malte Vesper
2015-02-02 22:05     ` riya khanna
2015-02-02 22:17       ` Greg KH
2015-02-02 22:46         ` riya khanna
2015-02-02 23:00           ` Greg KH
2015-02-02 23:50             ` riya khanna
2015-02-03  2:49               ` Valdis.Kletnieks at vt.edu
2015-02-03  3:09                 ` riya khanna
2015-02-03  3:15               ` Greg KH
2015-02-03 15:34                 ` riya khanna
2015-02-03 17:50                   ` Valdis.Kletnieks at vt.edu
2015-02-03 20:18                   ` Greg KH [this message]
2015-02-02 22:02 ` Valdis.Kletnieks at vt.edu
2015-02-02 22:04   ` riya khanna

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150203201841.GB5267@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).