Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple keyboard backends + fallback backend for xkbcommon #9

Closed
wants to merge 5 commits into from

Conversation

bluetech
Copy link
Contributor

Hi,
After reading your comments I thought this will be pretty easy to do and should alleviate some of your concerns.

It basically encapsulates input_xkb.{c,h} into a couple kmscon_* objects, and also adds a second fallback backend to show out it would work.

This defines the API the keyboard backends will need to implement. It is
based on what's in input_xkb.h but cleaned up and simplified.

Signed-off-by: Ran Benita <ran234@gmail.com>
This commit ports the XKB handling to the new kbd interface, and makes
the input subsystem use it without any direct knowledge of XKB.

Some code is moved around but there are no functional changes.

Signed-off-by: Ran Benita <ran234@gmail.com>
Currently it's required by xkbcommon. However, we will need it for other
backends as well, even with xkbcommon support disabled.

xproto consisted only of static header files. We use the XK_ keysym
definitions. It is therefore only required during compilation and we
shouldn't needlessly duplicate it ourselves.

Signed-off-by: Ran Benita <ran234@gmail.com>
This commit adds a very simple keyboard backend which does basic keycode
interpretation. It is used as a fallback when xkbcommon is unavailable
or is not required.

See the file header for what is supported.

Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: Ran Benita <ran234@gmail.com>
@dvdhrm
Copy link
Owner

dvdhrm commented Jan 22, 2012

I really like the cleanup and making xkbcommon a backend. However, why would someone want the "dumb" backend? Its really dumb and doesn't even make much sense for testing. Also, xkbcommon has almost no dependencies except xproto.

I will look over it the next week and then merge the stuff.
Thanks
David

@dvdhrm
Copy link
Owner

dvdhrm commented Jan 23, 2012

I have merged the cleanup (I got one less trivial conflict but I think I got it right). However, I haven't merged the dumb-backend, yet. I currently see no reason for this and skipping it will save us time maintaining it.

Thanks
David

@dvdhrm dvdhrm closed this Jan 23, 2012
@bluetech
Copy link
Contributor Author

Great, thanks.

About the merge: seems this commit got lost: e0a1902 it'd be nice to have it back - it makes some annoying debug messages appear for me :)

About the dumb backend: I just couldn't do the cleanup without something to show for it :) I guess it can be useful for doing valgrind and as a fallback for when xkbcommon is not there (given that it hasn't been released in any way yet and is somewhat clunky). So I'll keep it alive for random cherry picking, but again I don't mind it much.

@dvdhrm
Copy link
Owner

dvdhrm commented Jan 28, 2012

I have pulled the dumb-backend. Your arguments seem valid ;)
Before I will start working on your vte-changes I want to resolve all the current TODOs actually. Do you mind adding all the stuff you have in mind to TODO? I have seen several TODO-comments in the recent patches from you and I want to have a clean core before starting on the VTE.

Also I'd prefer discussing the ideas first. I don't want to write the VTE code twice because we did some mistake in the beginning.

Also, does the new GLES2 backend work for you? What about the freetype2 drawing? I tested it on my machines and all seems to work fine but I'd be glad to get some feedback.

Cheers
David

@bluetech
Copy link
Contributor Author

Hi,
Thanks for pulling. I'm trying to do some work on the xkbcommon side but it's not easy :)

I see you pretty much covered all of the TODOs. What's left there I see is:

  • Which TERM envvar to set. I think linux is fine?
  • What to exec. I think SHELL is fine for now, and we could revise that later.
  • All of the utmp/wtmp logging stuff. I don't know much about that, but I think that's also for later, it'd be too annoying now.

@bluetech
Copy link
Contributor Author

The VTE itself should be pretty easy, I think. I have a skeleton ready - basically a bunch of switch statements which gcc can optimize into tables if it wants - which I think is straightforward enough to be merged. This also applies to the keypress handling. These should make a nice inline TODO list, so I'll prepare a pull request for them.

The "harder" part is to get the console buffer handling just right and fast. There are complications like scroll regions and origin mode, and probably others, which are better to keep in mind from the start. I only tried some simple stuff here without changing anything that's already in place.

@bluetech
Copy link
Contributor Author

Oh and I tried the new font and GLES2 backends. I was hit by a couple mesa bugs but after that it seems much better than what was before. The rendering is as fast as I care for and there are no weird kernel messages sent to the console :) I don't really know much about opengl but it seems pretty impressive.

I do have one question so I'll open an issue for that.

@dvdhrm
Copy link
Owner

dvdhrm commented Jan 30, 2012

Hi,
Thanks for pulling. I'm trying to do some work on the xkbcommon side but it's not easy :)

Nice. If you think we can postpone some stuff, please add it to the new TODO list in the wiki.

I see you pretty much covered all of the TODOs. What's left there I see is:

  • Which TERM envvar to set. I think linux is fine?
  • What to exec. I think SHELL is fine for now, and we could revise that later.
  • All of the utmp/wtmp logging stuff. I don't know much about that, but I think that's also for later, it'd be too annoying now.

Yeah, I tried to resolve the TODOs myself. TERM=linux seems fine for now. I intend to emulate the linux-terminal for version 0.1. In future version we can try to emulate more complex VTs like vt100/vt220 etc.
SHELL and utmp/wtmp was added to the TODO as an entry: "Copy agetty functionality". We can postpone this.

Oh and I tried the new font and GLES2 backends. I was hit by a couple mesa bugs but after that it seems much
better than what was before. The rendering is as fast as I care for and there are no weird kernel messages sent
to the console :) I don't really know much about opengl but it seems pretty impressive.

What kind of mesa bugs? If they are serious, just tell me, I can report them upstream or try working around them. The rendering is pretty slow on my Intel-Atom so I think I will try some cairo drawing backend to avoid rendering on the GPU. However, good to hear that it works smoothly on your pc.

Please see the TODO in the github-wiki. I tried to put up some kind of roadmap. I want to get the VTE subsystem running so we have a working terminal for the 0.1 release. The 0.2 release should be a major cleanup and speed improvements.
All later releases (0.3, 0.4 or whatever) are grouped together under version 1.0 in the TODO list. Please add all kind of stuff that you have in mind to the list.

Cheers
David

@bluetech
Copy link
Contributor Author

Compiling from git fixed the first mesa bug, than I was hit by this:
https://bugs.freedesktop.org/show_bug.cgi?id=44919
But it's fixed now.

@dvdhrm
Copy link
Owner

dvdhrm commented Jan 30, 2012

Awesome. And yes, those libgbm, libEGL, xkbcommon libraries still have several bugs when used with libdrm but the wayland project is working on getting them resolved. Good for us.

Btw. I pulled your fixes. Thanks! The last one solved the performance problems on my machine. Obviously we did render the screen way to often, funny I didn't notice that. I need to find a better way to handle redraws, anyway, we shouldn't redraw it at every change but rather limit it to 50 frames or so.

Next two weeks I have a lot of other stuff to do but after that I will have lots of time to work on kmscon.
Regards
David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants