Skip to content
Snippets Groups Projects

xkb: simplify marshalling

All threads resolved!

The Xkb protocol is a complex beast, and so is it's current implementation. In order to clear the road for #1701 it needs to be untwisted, cleaned up and simplified.

Intentionally untwisting xkb in smaller, easily digestible steps, otherwise review would have become pretty hard.

Major points:

  • simplifying call and data flow (eg. try not to pass around partially filled reply struct, instead the required values explicitl)
  • reduce very short lived heap allocations by using stack (scoped fields) instead
  • prefer struct initializers instead of piece-by-piece assignments
  • split out cases where replies can also be contained in another one (xkbSend*(), ...)
  • collect reply fragments in local buffers, so the complete reply can be written out at once.

Once this queue is merged, further simplifications become easy -- see #1701..

Also makes it easier for adding non-socket/stream based transports (binder, shmem, virtio, ...).

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 81 commits

    • 298ab25f...c4481fc2 - 50 commits from branch xorg:master
    • c4481fc2...62a92738 - 21 earlier commits
    • 27c25126 - xkb: XkbSendNames(): move common code into a helper macro
    • 79008c4e - xkb: XkbSendGeometry(): pass in struct as value instead of pointer
    • ba749c69 - xkb: ProcXkbGetKbdByName() simplify reply struct initialization
    • 12cf3938 - xkb: ProcXkbGetKbdByName(): static initialization of sub-reply structs
    • 448307ca - xkb: split XkbSendMap()
    • 490b1d5f - xkb: split XkbSendCompatMap()
    • 6e1d6e39 - xkb: split XkbSendIndicatorMap()
    • 7ae3aade - xkb: split XkbSendNames()
    • 9836ac89 - xkb: split XkbSendGeometry()
    • b1d38fb5 - xkb: ProcXkbGetKbdByName(): collect sub-replies in buffer and write at once

    Compare with previous version

  • added 19 commits

    • b1d38fb5...2e6aa64e - 9 earlier commits
    • 9b71d8c4 - xkb: XkbSendNames(): move common code into a helper macro
    • aa3c6942 - xkb: XkbSendGeometry(): pass in struct as value instead of pointer
    • e0761c27 - xkb: ProcXkbGetKbdByName() simplify reply struct initialization
    • 6be25c35 - xkb: ProcXkbGetKbdByName(): static initialization of sub-reply structs
    • f0b9d1e8 - xkb: split XkbSendMap()
    • 8f202ad5 - xkb: split XkbSendCompatMap()
    • 8d61f8d6 - xkb: split XkbSendIndicatorMap()
    • 49b0fc61 - xkb: split XkbSendNames()
    • 83c21832 - xkb: split XkbSendGeometry()
    • 09d90c60 - xkb: ProcXkbGetKbdByName(): collect sub-replies in buffer and write at once

    Compare with previous version

  • added 10 commits

    • 354ed978 - xkb: XkbSendNames(): pass in struct as value instead of pointer
    • c4198c4c - xkb: XkbSendNames(): move common code into a helper macro
    • fe60ae7b - xkb: XkbSendGeometry(): pass in struct as value instead of pointer
    • a9ff378e - xkb: ProcXkbGetKbdByName() simplify reply struct initialization
    • 6856580c - xkb: ProcXkbGetKbdByName(): static initialization of sub-reply structs
    • 393b0f91 - xkb: split XkbSendMap()
    • 26ee97c1 - xkb: split XkbSendCompatMap()
    • 30ff68aa - xkb: split XkbSendIndicatorMap()
    • 60e87b8b - xkb: split XkbSendGeometry()
    • e55041ac - xkb: ProcXkbGetKbdByName(): collect sub-replies in buffer and write at once

    Compare with previous version

  • added 18 commits

    • e55041ac...7d3abbaa - 8 earlier commits
    • 7c6bc314 - xkb: let SendDeviceLedFBs() fill buffer instead of writing directly
    • e3394c49 - xkb: XkbSendNames(): pass in struct as value instead of pointer
    • 339b2c77 - xkb: XkbSendNames(): move common code into a helper macro
    • e2b857d5 - xkb: XkbSendGeometry(): pass in struct as value instead of pointer
    • 0443a6e9 - xkb: ProcXkbGetKbdByName() simplify reply struct initialization
    • 6aa968cf - xkb: ProcXkbGetKbdByName(): static initialization of sub-reply structs
    • 39893b35 - xkb: split XkbSendCompatMap()
    • 0c1c3aa1 - xkb: split XkbSendIndicatorMap()
    • e7ce4a29 - xkb: split XkbSendGeometry()
    • fa4002ad - xkb: ProcXkbGetKbdByName(): collect sub-replies in buffer and write at once

    Compare with previous version

  • added 11 commits

    • af173a0f - 1 earlier commit
    • d9e8ed74 - xkb: let SendDeviceLedFBs() fill buffer instead of writing directly
    • 69f8197e - xkb: XkbSendNames(): pass in struct as value instead of pointer
    • 6fc0026b - xkb: XkbSendNames(): move common code into a helper macro
    • 876744cd - xkb: XkbSendGeometry(): pass in struct as value instead of pointer
    • 00f8b404 - xkb: ProcXkbGetKbdByName() simplify reply struct initialization
    • 2be16819 - xkb: ProcXkbGetKbdByName(): static initialization of sub-reply structs
    • d0bfa4ee - xkb: split XkbSendCompatMap()
    • 22caadb6 - xkb: split XkbSendIndicatorMap()
    • 0e54e4d0 - xkb: split XkbSendGeometry()
    • eaadb2c6 - xkb: ProcXkbGetKbdByName(): collect sub-replies in buffer and write at once

    Compare with previous version

  • added 7 commits

    • 7e637b04 - xkb: XkbSendGeometry(): pass in struct as value instead of pointer
    • 70a06162 - xkb: ProcXkbGetKbdByName() simplify reply struct initialization
    • 4ba2c7dc - xkb: ProcXkbGetKbdByName(): static initialization of sub-reply structs
    • 957b989e - xkb: split XkbSendCompatMap()
    • 96eb6d44 - xkb: split XkbSendIndicatorMap()
    • 8eb9d8c6 - xkb: split XkbSendGeometry()
    • ed8462b1 - xkb: ProcXkbGetKbdByName(): collect sub-replies in buffer and write at once

    Compare with previous version

  • added 6 commits

    • 09610a32 - xkb: ProcXkbGetKbdByName(): static initialization of sub-reply structs
    • b82e6795 - xkb: split XkbSendMap()
    • 7a7b3102 - xkb: split XkbSendCompatMap()
    • 72b1a7a1 - xkb: split XkbSendIndicatorMap()
    • 08b83fdc - xkb: split XkbSendGeometry()
    • a071384d - xkb: ProcXkbGetKbdByName(): collect sub-replies in buffer and write at once

    Compare with previous version

  • Okay friends, removed all the VLAs from the queue (dropped them from history).

  • resolved all threads

  • added 2 commits

    • d52ce1b7 - xkb: split XkbSendGeometry()
    • 70d56bf2 - xkb: ProcXkbGetKbdByName(): collect sub-replies in buffer and write at once

    Compare with previous version

  • added 169 commits

    • 70d56bf2...27a5c591 - 141 commits from branch xorg:master
    • 27a5c591...ccc323d0 - 18 earlier commits
    • 95c1a0f1 - xkb: XkbSendNames(): pass in struct as value instead of pointer
    • 6851c9a0 - xkb: XkbSendNames(): move common code into a helper macro
    • 18751685 - xkb: XkbSendGeometry(): pass in struct as value instead of pointer
    • 42985c6c - xkb: ProcXkbGetKbdByName() simplify reply struct initialization
    • 60bf7d20 - xkb: ProcXkbGetKbdByName(): static initialization of sub-reply structs
    • 2246c375 - xkb: split XkbSendMap()
    • 05e49a61 - xkb: split XkbSendCompatMap()
    • cff2da4e - xkb: split XkbSendIndicatorMap()
    • 756e788e - xkb: split XkbSendGeometry()
    • 7a105774 - xkb: ProcXkbGetKbdByName(): collect sub-replies in buffer and write at once

    Compare with previous version

  • added 356 commits

    • 7a105774...a0834009 - 328 commits from branch xorg:master
    • a0834009...5d2679f4 - 18 earlier commits
    • c2c09f15 - xkb: XkbSendNames(): pass in struct as value instead of pointer
    • 66901951 - xkb: XkbSendNames(): move common code into a helper macro
    • bfd2a84e - xkb: XkbSendGeometry(): pass in struct as value instead of pointer
    • 8a216663 - xkb: ProcXkbGetKbdByName() simplify reply struct initialization
    • bfd5ca19 - xkb: ProcXkbGetKbdByName(): static initialization of sub-reply structs
    • 228fade0 - xkb: split XkbSendMap()
    • 5f667c59 - xkb: split XkbSendCompatMap()
    • dcefd215 - xkb: split XkbSendIndicatorMap()
    • e75ac011 - xkb: split XkbSendGeometry()
    • 4d134256 - xkb: ProcXkbGetKbdByName(): collect sub-replies in buffer and write at once

    Compare with previous version

  • Please register or sign in to reply
    Loading