Page MenuHomePhabricator

Add a new API for keymap cache
ClosedPublic

Authored by JHyun on Dec 28 2015, 2:47 AM.

Details

Summary

Originally, each keyboard devices could have their own keymap.

The one keyboard's keymap could different with others.
But for this, Ecore_Drm compile a new keymap when a keyboard is connected.
But this is a burden for some people who doesn't manage keymap for each keyboard.
They want to maintain only one keymap for system.
So, I added cached context/keymap and just ref/unref for each keyboard device.
People who want to different keymap for each keyboard just do not set cached 
context/keymap. Then Ecore_Drm maintain keymaps about each keyboard devices.
Test Plan

Connect a keyboard device and watch flow of ioctl.

Originally Ecore_Drm opened xkb data and compile keymap,
but after patch, that ioctl is disppeared.

Diff Detail

Repository
rEFL core/efl
Branch
work
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 943
Build 1008: arc lint + arc unit
JHyun updated this revision to Diff 7982.Dec 28 2015, 2:47 AM
JHyun retitled this revision from to Add a new API for keymap cache.
JHyun updated this object.
JHyun edited the test plan for this revision. (Show Details)
JHyun added reviewers: raster, devilhorns.
JHyun added subscribers: ohduna, input.hacker, cedric.
devilhorns requested changes to this revision.Dec 28 2015, 6:30 AM
devilhorns edited edge metadata.

Trying to compile this code leads to many compiler warnings :( These should be fixed:

CC       lib/ecore_drm/lib_ecore_drm_libecore_drm_la-ecore_drm_dbus.lo

In file included from modules/ecore_evas/engines/drm/ecore_evas_drm.c:15:
../src/lib/ecore_drm/Ecore_Drm.h:389:62: warning: declaration of

'struct xkb_keymap' will not be visible outside of this function
[-Wvisibility]

EAPI void ecore_drm_device_keyboard_cached_keymap_set(struct xkb_keymap *map);

^

1 warning generated.

CC       lib/ecore_drm/lib_ecore_drm_libecore_drm_la-ecore_drm_logind.lo

lib/ecore_drm/ecore_drm_device.c:121:53: warning: unused parameter 'names'

[-Wunused-parameter]
                 const struct xkb_rule_names *names,
                                              ^

lib/ecore_drm/ecore_drm_device.c:122:54: warning: unused parameter 'flags'

[-Wunused-parameter]
                 enum xkb_keymap_compile_flags flags)
                                               ^

lib/ecore_drm/ecore_drm_device.c:155:26: warning: implicit declaration of

function 'ecore_drm_seat_evdev_list_get' is invalid in C99
[-Wimplicit-function-declaration]
 EINA_LIST_FOREACH(ecore_drm_seat_evdev_list_get(seat), l3, edev)
                   ^

../src/lib/eina/eina_list.h:1415:12: note: expanded from macro

    'EINA_LIST_FOREACH'
for (l = list,                         \
         ^

lib/ecore_drm/ecore_drm_device.c:155:8: warning: incompatible integer to pointer

conversion assigning to 'Eina_List *' (aka 'struct _Eina_List *') from
'int' [-Wint-conversion]
 EINA_LIST_FOREACH(ecore_drm_seat_evdev_list_get(seat), l3, edev)
 ^                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../src/lib/eina/eina_list.h:1415:10: note: expanded from macro

    'EINA_LIST_FOREACH'
for (l = list,                         \
       ^
CC       lib/ecore_drm/lib_ecore_drm_libecore_drm_la-ecore_drm.lo

4 warnings generated.

src/lib/ecore_drm/Ecore_Drm.h
376

missing @since 1.17

388

missing @since 1.17

src/lib/ecore_drm/ecore_drm_device.c
155

This function does not exist in Ecore_Drm, so this code does not compile

This revision now requires changes to proceed.Dec 28 2015, 6:30 AM
JHyun updated this revision to Diff 7987.Dec 28 2015, 11:13 PM
JHyun edited edge metadata.

Remove warnings and a nonexsistence function.

JHyun updated this revision to Diff 7991.Dec 29 2015, 3:42 AM
JHyun edited edge metadata.

Return if already same context/keymap is set.

devilhorns added inline comments.Dec 29 2015, 5:17 AM
src/lib/ecore_drm/Ecore_Drm.h
36

Why is this structure declared here in a public header ??

Adding derek as another reviewer (in case I overlooked something) :)

JHyun updated this revision to Diff 8000.Dec 29 2015, 5:40 PM

Move include a xkbcommon header point ecore_drm_private.h to Ecore_Drm.h

JHyun added a comment.Dec 29 2015, 5:44 PM

I replied your comment in code and upload a new patchset.

src/lib/ecore_drm/Ecore_Drm.h
36

ecore_drm_private.h includes xkbcommon.h, so currently
"its scope is only this definition or declaration, which is probably not what you want [enabled by default]"
warning is occurred.
So I declared structure in this point to avoid that warning.
But move include point is a more right way.
So I upload a new patch set.

ManMower accepted this revision.Dec 30 2015, 8:42 AM
ManMower edited edge metadata.

Looks fine to me. :)

devilhorns accepted this revision.Dec 30 2015, 9:44 AM
devilhorns edited edge metadata.

I'll push this in tomorrow morning

This revision is now accepted and ready to land.Dec 30 2015, 9:44 AM

@JHyun Can you please rebase this patch against current efl-git ?? I tried to apply it this morning, but the patch fails

JHyun updated this revision to Diff 8024.Jan 3 2016, 3:28 PM
JHyun edited edge metadata.

Rebase commit

JHyun added a comment.Jan 3 2016, 3:32 PM

Oh.. Sorry mistake rebase, I'll fix it.

JHyun updated this revision to Diff 8025.Jan 3 2016, 3:50 PM

rebase

JHyun updated this revision to Diff 8026.Jan 3 2016, 4:18 PM

Rebase commit

JHyun added a comment.Jan 3 2016, 4:20 PM

Okay.. Unfortunately some mistakes were occurred, But finally I finished rebase.
Check my last commit.

devilhorns closed this revision.Jan 4 2016, 5:48 AM