Skip to content

hwcomposer: Want so contribute and cleanup #62

@Molytho

Description

@Molytho

I was investigating waydroid/waydroid#1875 and was looking at hwcomposer.
To me the code in hwcomposer.cpp looks like it could get some cleanup
I mean things like:

  1. wp_presentation_feedback being stored in struct buffer which is wrong compared to the wayland protocol associating wp_presentation_feedback with wl_surface
  2. Misuse of wl_surface_damage. The coordinates should be surface-local but buffer-local coordinates are given here
    wl_surface_damage(pdev->display->cursor_surface, 0, 0, buf->width, buf->height);
  3. Some functions are huge (especially hwc_set) which could be improved by factoring out some functionality to new functions

I currently have much free time and would like to improve code quality.
My questions is: Is a pull request refactoring code reviewed and accepted? I would like to avoid putting in the work just so that it is rejected.

After I finished refactoring I want to implement HWC_DEVICE_API_VERSION_1_5 because of its damage tracking.

Side note on your fix for waydroid/waydroid#1875 (13b570b):
I don't think that the HWC_GEOMETRY_CHANGED flag is really the right thing to check for here.
The underlying issue is that a new buffer might get the same buffer_handle_t as a buffer we saw previously which is technically also possible without HWC_GEOMETRY_CHANGED being set.
I suggest something like this Molytho@3fe3386

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions