Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • mvaldina/weston
  • ant8me/weston
  • JaredHu/weston
  • drawat/weston
  • bnieuwenhuizen/weston
  • Robyn.marie/weston
  • dwrobel/weston
  • yjheo/weston
  • dos/weston
  • longjunyu2/weston
  • soerenmeier/weston
  • igor.torrente/weston
  • luckyziv/weston
  • qyliss/weston
  • tantan/weston
  • wengxt/weston
  • mroussin/weston
  • n3rdopolis/weston
  • xiangxuy/weston
  • RAOF/weston
  • afrantzis/weston
  • lujin/weston
  • jayjona42/weston
  • ascent/weston
  • inzamam.15/weston
  • bbara93/weston
  • adoan/weston
  • Vivalavina/weston
  • iason.paraskevopoulos/weston
  • phnaharris/weston
  • mforney/weston
  • linkmauve/weston
  • xexaxo/weston
  • rajendraprasadkj/weston
  • xeechou/weston
  • learning/weston
  • agners/weston
  • ianr/weston
  • eucan/weston
  • heemin.lee/weston
  • nniro/weston
  • PaulKocialkowski/weston
  • NaveenKumar/weston
  • msisov/weston
  • ollieparanoid/weston
  • pH5/weston
  • dbaker/weston
  • gtristan/weston
  • khosokawa/weston
  • lubosz/weston
  • Fahien/weston
  • m.tretter/weston
  • valpackett/weston
  • marimeireles/weston
  • afd/weston
  • lk1025/weston
  • marler8997/weston
  • jianglei121381/weston
  • flakylawww/weston
  • ayaka/weston
  • bbeckett/weston
  • rdp.effort/weston
  • Ganjing0224/weston
  • jcline/weston
  • bl4ckb0ne/weston
  • Bastian-Krause/weston
  • fifi899173/weston
  • jpewhacker/weston
  • yuanye100/weston
  • t-8ch/weston
  • HarshaMM/weston
  • david.turner/weston
  • wismill/weston
  • rsmith/weston
  • rohanjulka19/weston
  • shadeslayer/weston
  • sjoerd/weston
  • barry.song/weston
  • petervdperk/weston
  • renjiayuan1314/weston
  • HeYong/weston
  • bluesirhl/weston
  • macpijan/weston
  • andreinonea/weston
  • vanfanel/weston
  • mstoeckl/weston
  • chewi/weston
  • shierote/weston
  • tmaillart1/weston
  • jh-hsd/weston
  • bgjdarm/weston
  • anurup_m/weston
  • lucaweiss/weston
  • dima/weston
  • marysaka/weston
  • daissi/weston
  • vnguyentrong/weston
  • enocknyaega/weston
  • kang-sooyeon/weston
  • tpetazzoni/weston
  • mihlenfeldt/weston
  • rgallaispou/weston
  • chienpv/weston
  • kraj/weston
  • stolk/weston
  • Emantor/weston
  • kusma/weston
  • bmkimg/weston
  • 9531718244loco/weston
  • Ts/weston
  • kennylevinsen/weston
  • eyelash/weston
  • Igortorrente/weston
  • pleasurefish/weston
  • ahe/weston
  • ekurzinger/weston
  • pochu/weston
  • saavedra.pablo/weston
  • borneoa/weston
  • JimmyOhn/weston
  • ShivakumarVH/weston
  • Cwiiis/weston
  • romangg/weston
  • zubzub/weston
  • askebm/weston
  • ewtoombs/weston
  • wolf._.lael666/weston
  • dr3020187/weston
  • kxing/weston_hpd
  • filip-hejsek/weston
  • xndcn/weston
  • therealkenc/weston
  • C0rn3j/weston
  • tmaillart/weston
  • leandrohrb/weston
  • snow/weston
  • marex/weston
  • bnlrnz/weston
  • zhourunsheng2008/weston
  • zhouliang/weston
  • isinyaaa/weston
  • JeffyCN/weston
  • tzimmermann/weston
  • christian-rauch/weston
  • krh/weston
  • Rigo-V/weston
  • archiesix/weston
  • cwjo/weston
  • hedone21/weston
  • liyi42/weston
  • uniontechWu/weston
  • justdoGIT/weston
  • ajax/weston
  • pmenzel/weston
  • mominurisiamm887/weston
  • denix0/weston
  • ivyl/weston
  • fallahmahid.mahdi/weston
  • Alvarito050506/weston
  • obbardc/weston
  • joantolo/weston
  • zumbi/weston
  • doubleagent3276/weston
  • leoli/weston
  • dude/weston
  • cardenasvitealejandro/weston
  • ljia5/weston
  • Trigger.Huang/weston
  • swick/weston
  • Wladmis/weston
  • vyivel/weston
  • orbitcowboy/weston
  • AIDEA775/weston
  • maos20008/weston
  • mvicomoya/weston
  • bbrezillon/weston
  • wujiansun/weston
  • Benjamin_Loison/weston
  • rhelmot/weston
  • rgonzalez/weston
  • ekapllaj/weston
  • Shugyousha/weston
  • carbn/weston
  • derekf/weston
  • gyeyoung976/weston
  • dhobsong/weston
  • jeri.li/weston
  • mtey/weston
  • etom/weston
  • azeps/weston
  • champagneg/weston
  • makepost/weston
  • trem/weston
  • hwentland/weston
  • Ambyjkl/weston
  • YDinhVan/weston
  • pixellon/weston
  • daniels/weston
  • OctopusET/weston
  • emersion/weston
  • gilvbp/weston
  • yadneshk/weston
  • mvlad/weston
  • wayland/weston
  • phreer/weston
  • diegonieto/weston
  • vliaskov/weston
  • Vivek/weston
  • sami/weston
  • creiter/weston
  • luigi.santivetti/weston
  • aknautiyal/weston
  • martinetd/weston
  • 5HT/weston
  • yayowd/qimm
  • khangtb/weston
  • Laplac2/weston
  • pritbisw/weston
  • molinari/weston
  • vvavrychuk/weston
  • zzyiwei/weston
  • vanvugt/weston
  • pq/weston
  • qaqsw24/weston
  • gfxstrand/weston
  • alex.kanavin/weston
  • pinchyguey45/weston
  • davidre/weston
  • bigbear1385/weston
  • zzag/weston
  • benh/weston
  • harpreetbasra1313/weston
  • phomes/weston
  • rmader/weston
  • Heartyharts/weston
  • arandomhuman/weston
  • kchibisov/weston
  • hwti/weston
  • abhinavk/weston
  • vitalyp/weston
  • pedestrianlove/weston
  • sardemff7/weston
  • Ivaniku/tayland
  • JoseExposito/weston
  • zeerd/weston
  • jadahl/weston
  • sophia/weston
  • mol/weston
  • rawoul/weston
  • maxice8/weston
  • whot/weston
  • Qingwu-Li/weston
  • lfrb/weston
  • heftig/weston
  • Calandracas/weston
  • SergioGDR/weston
  • Foreal/weston
  • ghishadow/weston
  • puhui/weston
  • dmitry.batrak1/weston
  • fanbaby6/weston
  • chiragkhurana/weston
  • amaksoft/weston
  • surban/weston
  • smit-mayani/weston
  • jwillikers/weston
  • meshki022/weston
  • pritamabiswas/weston
  • antonino/weston
  • k77951586/weston
  • ChaoGuo/weston
  • ColinKinloch/weston
  • paraaz4959/weston
  • ivan.nikolaenko/weston
  • adarshgm/weston
  • ericruei/weston
  • harishkrupo/weston
  • VKadasani/weston
  • jameshilliard/weston
  • davidedmundson/weston
  • strassek/weston
  • flto/weston
  • Kishore409/weston
  • ktullavik/weston
  • Eugeniy.Paltsev/weston
  • sameer.lattannavar/weston
  • jesstindean85/weston
  • ashie/weston
  • Zamundaaa/weston
  • jlindgren90/weston
  • LARathbone/weston
  • g0hl1n/weston
  • matth/weston
  • nicolesager7/weston
  • hitong602/weston
  • Rpegusus2233/weston
  • bentiss/weston
  • hthiery/weston
  • thewayoftherob/weston
  • ofourdan/weston
  • enunes/weston
  • tomek/weston
  • bugaevc/weston
  • eero-t/weston
304 results
Show changes
Commits on Source (23)
  • Michael Tretter's avatar
    ivi-shell: bring back reference weston.ini · 16e3f27f
    Michael Tretter authored
    
    In commit d8e09afc ("tests: Convert ivi-shell-app-test.c to use
    `weston_ini_setup`") the reference weston.ini for the ivi-shell was
    removed, because it is not required by the test anymore.
    
    The reference weston.ini still has value as an example for the ivi-shell
    and how the ivi-shell-user-interface has to be configured. Retrieving
    this information from the test case is not intuitive. Furthermore, the
    file is still referenced by the ivi-shell/README, and the
    configuration_data for generating the file was not fully removed.
    
    Bring back the reference weston.ini for the ivi-shell and, while at it, cleanup
    the configuration_data() to define only keys that are actually used in
    weston.ivi.in.
    
    Signed-off-by: Michael Tretter's avatarMichael Tretter <m.tretter@pengutronix.de>
    16e3f27f
  • Alexandros Frantzis's avatar
    input: Use cursor surface dimensions to evaluate presence of content · 28d66344
    Alexandros Frantzis authored
    
    When setting a cursor surface, use the surface dimensions, instead of the
    weston_surface buffer reference, to check if the surface has any
    content. A weston_surface without any buffer reference may in fact
    have a buffer which was committed in a previous pointer entry, dropped
    by weston_surface and now held only internally by the renderer.
    
    Without this fix, when a pointer enters a surface, the cursor image is
    not correctly updated if we set a cursor surface with an already
    committed buffer from a previous pointer entry, without recommitting the
    cursor buffer for the current entry. This can be seen, for example, in
    the experimental Wine Wayland driver which handles the cursor in a way
    that leads to the following scenario:
    
    Setup: cursor_surface.attach(buffer) & cursor_surface.commit()
    On first wl_pointer.enter: pointer.set_cursor(cursor_surface)
    compositor/renderer redraws
    wl_pointer.leave
    On second wl_pointer.enter: pointer.set_cursor(cursor_surface)
    
    When handling the second pointer.set_cursor() request the current code
    doesn't find a buffer attached to the cursor_surface (only the renderer
    now has a reference to it), so it doesn't update the respective view for
    the cursor.
    
    Signed-off-by: default avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
    28d66344
  • Alexandros Frantzis's avatar
    tests: Store the pointer event serial · 4ea9be51
    Alexandros Frantzis authored
    
    Store the pointer serial for events that provide one, so that it can be
    used by tests to send requests that require it (e.g., setting the cursor
    surface).
    
    Signed-off-by: default avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
    4ea9be51
  • Alexandros Frantzis's avatar
    tests: Add shot test for pointer cursor behavior · 6ee80ecc
    Alexandros Frantzis authored
    
    Add a regression test to verify that the cursor image is correctly
    updated when setting a cursor surface with an already committed buffer
    from a previous pointer entry, without recommitting a cursor buffer for
    the current entry.
    
    Signed-off-by: default avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
    6ee80ecc
  • Pekka Paalanen's avatar
    pixman-renderer: draw_view -> draw_paint_node · 79885af1
    Pekka Paalanen authored and Pekka Paalanen's avatar Pekka Paalanen committed
    
    A following patch will need the paint node in draw_view() for color
    transformations.
    
    While passing the paint node into draw_paint_node, also use the paint
    node. This is a pure refactoring with no functional change.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    79885af1
  • Pekka Paalanen's avatar
    gl-renderer: draw_view -> draw_paint_node · da0f7ea4
    Pekka Paalanen authored and Pekka Paalanen's avatar Pekka Paalanen committed
    
    A following patch will need the paint node in
    gl_shader_config_init_for_view() for color transformations.
    
    While passing the paint node through, rename the functions to be more
    appropriate and get surface/view/output from the paint node.
    
    This is a pure refactoring with no functional change.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    da0f7ea4
  • Pekka Paalanen's avatar
    libweston: introduce CMS component architecture · 90a5ffa0
    Pekka Paalanen authored and Pekka Paalanen's avatar Pekka Paalanen committed
    See: #467 (comment 814985)
    
    
    
    This starts building the framework required for implementing color
    management.
    
    The main new interface is struct weston_color_manager. This commit also
    adds a no-op color manager implementation, which is used if no other
    color manager is loaded. This no-op color manager simply provides
    identity color transforms for everything, so that Weston keeps running
    exactly like before.
    
    weston_color_manager interface is incomplete and will be extended later.
    
    Colorspace objects are not introduced in this commit. However, when
    client content colorspace and output colorspace definitions are
    combined, they will produce color transformations from client content to
    output blending space and from output blending space to output space.
    
    This commit introduces a placeholder struct for color transforms,
    weston_color_transform. Objects of this type are expected to be heavy to
    create and store, which is why they are designed to be shared as much as
    possible, ideally making their instances unique. As color transform
    description is intended to be generic in libweston core, renderers and
    backends are expected to derive their own state for each transform
    object as necessary. Creating and storing the derived state maybe be
    expensive as well, more the reason to re-use these objects as much as
    possible. E.g. GL-renderer might upload a 3D LUT into a texture and keep
    the texture around. DRM-backend might create a KMS blob for a LUT and
    keep that around.
    
    As a color transform depends on both the surface and the output, a
    transform object may need to be created for each unique pair of them.
    Therefore color transforms are referenced from weston_paint_node. As
    paint nodes exist for not just surface+output but surface+view+output
    triplets, the code ensures that all paint nodes (having different view)
    for the same surface+output have the same color transform state.
    
    As a special case, if weston_color_transform is NULL, it means identity
    transform. This short-circuits some checks and memory allocations, but
    it does mean we use a separate member on weston_paint_node to know if
    the color transform has been initialized or not.
    
    Color transformations are pre-created at the weston_output
    paint_node_z_order_list creation step. Currently the z order lists
    contain all views globally, which means we populate color transforms we
    may never need, e.g. a view is never shown on a particular output.
    This problem should get fixed naturally when z order lists are
    constructed "pruned" in the future: to contain only those paint nodes
    that actually contribute to the output's image.
    
    As nothing actually supports color transforms yet, both renderers and
    the DRM-backend assert that they only get identity transforms. This
    check has the side-effect that all surface-output pairs actually get a
    weston_surface_color_transform_ref even though it points to NULL
    weston_color_transform.
    
    This design is inspired by Sebastian Wick's Weston color management
    work.
    
    Co-authored-by: default avatarSebastian Wick <sebastian@sebastianwick.net>
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    90a5ffa0
  • Pekka Paalanen's avatar
    color: add output color transform API · 1d2eee20
    Pekka Paalanen authored and Pekka Paalanen's avatar Pekka Paalanen committed
    
    This is the blending space to monitor space color transform. It needs to
    be implemented in the renderers, unless a backend sets
    from_blend_to_output_by_backend = true, in which case the backend does
    it and the renderer does not.
    
    The intention is that from_blend_to_output_by_backend can be toggled
    frame by frame to allow backends to react to dynamic change of output
    color profile.
    
    For now, renderers just assert that they don't need to do anything for
    output color transform.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    1d2eee20
  • Pekka Paalanen's avatar
    color: add from sRGB to output color transformation · cda3951a
    Pekka Paalanen authored and Pekka Paalanen's avatar Pekka Paalanen committed
    
    This is needed when drawing anything internal directly to an output,
    like the borders/decorations in a nested compositor setup. This makes
    the assumption that the internal stuff starts in sRGB, which should be
    safe. As borders are never blended with other content, this should also
    be sufficient.
    
    This patch is a reminder that that path exists, rather than a real
    implementation. To be implemented when someone needs it.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    cda3951a
  • Pekka Paalanen's avatar
    color: add from sRGB to blending color transformation · 8fb23ed1
    Pekka Paalanen authored and Pekka Paalanen's avatar Pekka Paalanen committed
    
    This is needed when the compositor produces any content internally:
    - the lines in triangle fan debug
    - the censoring color fill (unmet HDCP requirements)
    
    Solid color surfaces do not need this special-casing because
    weston_surface is supposed to carry color space information, which will
    get used in gl_shader_config_init_for_view().
    
    This makes sure the internally produced graphics fit in, e.g on a
    monitor in HDR mode.
    
    For now, just ensure there is an identity transformation. Actual
    implementations in GL-renderer will follow later.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    8fb23ed1
  • Pekka Paalanen's avatar
    libweston: begin color-lcms plugin · 5e79dd48
    Pekka Paalanen authored and Pekka Paalanen's avatar Pekka Paalanen committed
    
    This creates the color-lcms plugin that in the future will be using
    Little CMS as the color matching module, processing ICC profiles, and
    producing HDR tone mappings.
    
    Right now, this new plugin is functionally equivalent to the no-op color
    manager, except it already links to lcms2 and checks that the renderer
    supports color operations.
    
    Color-lcms is a libweston plugin that is loaded with explicit
    weston_compositor API. This does not currently allow loading alternative
    color manager plugins. External color manager plugins might be
    considered in the future when the libweston APIs around color management
    stabilize.
    
    This libweston plugin uses the same build option as the old cms-static
    Weston plugins, as they both need lcms2. The minimum version for lcms2
    was chosen by what Debian Buster provides today and for no other reason.
    
    This plugin intends to support the Wayland CM&HDR protocol extension and
    hence sets supports_client_protocol to true. This will expose the
    protocol extension to clients when it gets implemented.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    5e79dd48
  • Pekka Paalanen's avatar
    compositor: add weston.ini option to enable color management · c87fa240
    Pekka Paalanen authored and Pekka Paalanen's avatar Pekka Paalanen committed
    
    This new option allows loading the color-lcms plugin.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    c87fa240
  • Pekka Paalanen's avatar
    tests: ensure color-lcms plugin loads · 21b8ad5a
    Pekka Paalanen authored and Pekka Paalanen's avatar Pekka Paalanen committed
    
    This is a trivial smoke test to ensure that the color-lcms plugin is
    loadable.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    21b8ad5a
  • Pekka Paalanen's avatar
    gl-renderer: do not unbind the context on output destroy · 6d0aa8f0
    Pekka Paalanen authored
    
    If we make EGL_NO_CONTEXT current, all following GL calls are
    no-ops. This will be a problem when gl-renderer introduces
    gl_renderer_color_transform containing GL textures and needs to destroy
    them when weston_color_transform is destroyed. Mesa would print the the
    warning that glDeleteTextures is no-op.
    
    To fix this, keep our GL context current when destroying a GL output.
    
    In case EGL_KHR_surfaceless_context is not available, we must use
    dummy_surface.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    6d0aa8f0
  • Pekka Paalanen's avatar
    Revert "gl-renderer: Make dummy surface current after all outputs are gone" · 401e1909
    Pekka Paalanen authored
    
    This reverts commit 36d699a1.
    
    A different way to fix this same issue is the previous commit
    "gl-renderer: do not unbind the context on output destroy"
    which is needed for other reasons.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    401e1909
  • Pekka Paalanen's avatar
    gl-renderer: require GL ES 3.0 for color management · 734c2278
    Pekka Paalanen authored
    
    Trying to support GL ES 2.0 + extensions along with GL ES 3.0 for better
    control is becoming too complicated fast. In this patch you see the
    GL_RGBA vs. GL_RBA16F and GL_HALF_FLOAT vs. GL_HALF_FLOAT_OES paths.
    More such cases will come, e.g. GL_RED_EXT vs. GL_R32F.
    
    Make things simpler and require GL ES 3.0 +
    GL_EXT_color_buffer_half_float for all color management related
    functionality. If one doesn't have GL ES 3.0, all you lose is color
    management.
    
    Also, all extensions needed by color transformation operations are
    gathered under one boolean flag instead of having a flag per extension,
    again for simplicity.
    
    This makes the GL ES extension handling much easier.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    734c2278
  • Pekka Paalanen's avatar
    gl-renderer: define fragment shader compile_const · 37fe6fde
    Pekka Paalanen authored
    
    Compile time constants play an important role in keeping the shader
    programs fast. Introduce an informal annotation to mark compile time
    constants to make the shader code easier to reason with.
    
    This will make much more sense once functions with compile time constant
    parameters are added.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    37fe6fde
  • Pekka Paalanen's avatar
    gl-renderer: use shadow framebuffer automatically · d2cfbff1
    Pekka Paalanen authored
    
    This creates the FP16 shadow framebuffer automatically if the color
    transformation from blending space to output space is not identity and
    the backend does not claim to implement it on the renderer's behalf.
    
    That makes the weston_output_set_renderer_shadow_buffer() API and
    use-renderer-shadow weston.ini option obsolete.
    
    To still cater for the one test that needs to enable the shadow
    framebuffer in spite of not needing it for color correct blending, the
    quirk it uses now also forces the shadow.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    d2cfbff1
  • Pekka Paalanen's avatar
    Revert "compositor: add weston.ini option use-renderer-shadow" · 478123b9
    Pekka Paalanen authored
    
    This reverts commit 81ef6d0a.
    
    This also removes a bit from "tests: ensure color-lcms plugin loads".
    
    Use of the shadow buffer is determined automatically based on
    color transformations by the previous commit
    "gl-renderer: use shadow framebuffer automatically".
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    478123b9
  • Pekka Paalanen's avatar
    libweston: remove weston_output_set_renderer_shadow_buffer() · f0c61044
    Pekka Paalanen authored
    
    This is no longer used.
    
    This was originally added in b5265af6.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    f0c61044
  • Alexandros Frantzis's avatar
    backend-drm: Clear drm_output cursor_view when view is destroyed · 10937fee
    Alexandros Frantzis authored and Pekka Paalanen's avatar Pekka Paalanen committed
    
    The DRM backend uses changes in the cursor view memory address and
    surface damage to detect when it needs to re-upload to a cursor plane
    framebuffer.
    
    However, when a cursor view is destroyed and then recreated, e.g., when
    the pointer cursor surface is updated, the newly created view may have
    the same memory address as the just destroyed one. If no new cursor
    buffer is provided (because it was attached, committed and used
    previously) when this address reuse occurs, then there also isn't any
    updated surface damage and the backend doesn't update the cursor plane
    framebuffer at all.
    
    To fix this issue utilize the destroy signal to track when the cursor
    view is destroyed, and clear the cached cursor_view value in drm_output.
    After clearing the cached value, the next cursor view is always
    considered new and thus uploaded to the plane properly.
    
    Signed-off-by: default avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
    10937fee
  • Pekka Paalanen's avatar
    tests: fix refname leaks · b0eb0598
    Pekka Paalanen authored and Pekka Paalanen's avatar Pekka Paalanen committed
    
    Reported by ASan.
    
    Direct leak of 1468 byte(s) in 48 object(s) allocated from:
        #0 0x7f20d7ae0330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
        #1 0x7f20d76894b7 in _IO_vasprintf /build/glibc-vjB4T1/glibc-2.28/libio/vasprintf.c:73
        #2 0x7f20d7a66827 in __interceptor_vasprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6f827)
        #3 0x7f20d7a66f76 in asprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6ff76)
        #4 0x5598e3fbcdfc in buffer_transform ../../git/weston/tests/buffer-transforms-test.c:122
        #5 0x5598e3fc9add in run_test ../../git/weston/tests/weston-test-runner.c:162
        #6 0x5598e3fca17e in run_case ../../git/weston/tests/weston-test-runner.c:277
        #7 0x5598e3fc9f24 in for_each_test_case ../../git/weston/tests/weston-test-runner.c:235
        #8 0x5598e3fca406 in testsuite_run ../../git/weston/tests/weston-test-runner.c:311
        #9 0x7f20d3523b6b in client_thread_routine ../../git/weston/tests/weston-test.c:479
        #10 0x7f20d75e8fa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
        #11 0x7f20d770a4ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)
    
    Direct leak of 978 byte(s) in 42 object(s) allocated from:
        #0 0x7f26fed07330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
        #1 0x7f26fe8b04b7 in _IO_vasprintf /build/glibc-vjB4T1/glibc-2.28/libio/vasprintf.c:73
        #2 0x7f26fec8d827 in __interceptor_vasprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6f827)
        #3 0x7f26fec8df76 in asprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6ff76)
        #4 0x55989ba8c2bc in output_damage ../../git/weston/tests/output-damage-test.c:201
        #5 0x55989ba8c0cb in wrapoutput_damage ../../git/weston/tests/output-damage-test.c:176
        #6 0x55989ba99131 in run_test ../../git/weston/tests/weston-test-runner.c:162
        #7 0x55989ba997d2 in run_case ../../git/weston/tests/weston-test-runner.c:277
        #8 0x55989ba99578 in for_each_test_case ../../git/weston/tests/weston-test-runner.c:235
        #9 0x55989ba99a5a in testsuite_run ../../git/weston/tests/weston-test-runner.c:311
        #10 0x7f26fa57ab6b in client_thread_routine ../../git/weston/tests/weston-test.c:479
        #11 0x7f26fe80ffa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
        #12 0x7f26fe9314ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)
    
    Direct leak of 1696 byte(s) in 56 object(s) allocated from:
        #0 0x7f077107f330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
        #1 0x7f0770c284b7 in _IO_vasprintf /build/glibc-vjB4T1/glibc-2.28/libio/vasprintf.c:73
        #2 0x7f0771005827 in __interceptor_vasprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6f827)
        #3 0x7f0771005f76 in asprintf (/lib/x86_64-linux-gnu/libasan.so.5+0x6ff76)
        #4 0x563e6ae36dfc in output_transform ../../git/weston/tests/output-transforms-test.c:122
        #5 0x563e6ae43add in run_test ../../git/weston/tests/weston-test-runner.c:162
        #6 0x563e6ae4417e in run_case ../../git/weston/tests/weston-test-runner.c:277
        #7 0x563e6ae43f24 in for_each_test_case ../../git/weston/tests/weston-test-runner.c:235
        #8 0x563e6ae44406 in testsuite_run ../../git/weston/tests/weston-test-runner.c:311
        #9 0x7f076ca26b6b in client_thread_routine ../../git/weston/tests/weston-test.c:479
        #10 0x7f0770b87fa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
        #11 0x7f0770ca94ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    b0eb0598
  • Pekka Paalanen's avatar
    tests: fix leaks in bad-buffer · 819054ce
    Pekka Paalanen authored and Pekka Paalanen's avatar Pekka Paalanen committed
    
    Fixes all ASan reported leaks for this test.
    
    If frame_callback_wait_nofail() returns before the callback is handled,
    the callback is not destroyed automatically. This happens on a protocol
    error. This test intentionally triggers a protocol error.
    
    Signed-off-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
    819054ce
Showing
with 1064 additions and 91 deletions
......@@ -1086,6 +1086,7 @@ weston_compositor_init_config(struct weston_compositor *ec,
struct xkb_rule_names xkb_names;
struct weston_config_section *s;
int repaint_msec;
bool color_management;
bool cal;
/* weston.ini [keyboard] */
......@@ -1125,6 +1126,13 @@ weston_compositor_init_config(struct weston_compositor *ec,
weston_log("Output repaint window is %d ms maximum.\n",
ec->repaint_msec);
weston_config_section_get_bool(s, "color-management",
&color_management, false);
if (color_management) {
if (weston_compositor_load_color_manager(ec) < 0)
return -1;
}
/* weston.ini [libinput] */
s = weston_config_get_section(config, "libinput", NULL, NULL);
weston_config_section_get_bool(s, "touchscreen_calibrator", &cal, 0);
......@@ -1282,29 +1290,6 @@ wet_output_set_transform(struct weston_output *output,
return 0;
}
static int
wet_output_set_renderer_shadow(struct weston_output *output,
struct weston_config_section *section)
{
bool use_shadow = false;
if (section) {
weston_config_section_get_bool(section,
"use-renderer-shadow",
&use_shadow, false);
}
if (use_shadow) {
if (!weston_output_set_renderer_shadow_buffer(output)) {
weston_log("Output \"%s\" does not support use-renderer-shadow.\n",
output->name);
return -1;
}
}
return 0;
}
static void
allow_content_protection(struct weston_output *output,
struct weston_config_section *section)
......@@ -1822,9 +1807,6 @@ drm_backend_output_configure(struct weston_output *output,
allow_content_protection(output, section);
if (wet_output_set_renderer_shadow(output, section) < 0)
return -1;
return 0;
}
......@@ -2635,12 +2617,6 @@ headless_backend_output_configure(struct weston_output *output)
.scale = 1,
.transform = WL_OUTPUT_TRANSFORM_NORMAL
};
struct weston_config *wc = wet_get_config(output->compositor);
struct weston_config_section *section;
section = weston_config_get_section(wc, "output", "name", output->name);
if (wet_output_set_renderer_shadow(output, section) < 0)
return -1;
return wet_configure_windowed_output_from_config(output, &defaults);
}
......
......@@ -79,6 +79,7 @@ struct linux_dmabuf_buffer;
struct weston_recorder;
struct weston_pointer_constraint;
struct ro_anonymous_file;
struct weston_color_transform;
enum weston_keyboard_modifier {
MODIFIER_CTRL = (1 << 0),
......@@ -372,7 +373,10 @@ struct weston_output {
bool enabled; /**< is in the output_list, not pending list */
int scale;
bool use_renderer_shadow_buffer;
struct weston_color_transform *from_sRGB_to_output;
struct weston_color_transform *from_sRGB_to_blend;
struct weston_color_transform *from_blend_to_output;
bool from_blend_to_output_by_backend;
int (*enable)(struct weston_output *output);
int (*disable)(struct weston_output *output);
......@@ -1046,6 +1050,7 @@ struct weston_touch_calibrator;
struct weston_desktop_xwayland;
struct weston_desktop_xwayland_interface;
struct weston_debug_compositor;
struct weston_color_manager;
/** Main object, container-like structure which aggregates all other objects.
*
......@@ -1114,12 +1119,11 @@ struct weston_compositor {
struct weston_plane primary_plane;
uint32_t capabilities; /* combination of enum weston_capability */
struct weston_color_manager *color_manager;
struct weston_renderer *renderer;
pixman_format_code_t read_format;
struct weston_backend *backend;
struct weston_launcher *launcher;
struct wl_list plugin_api_list; /* struct weston_plugin_api::link */
......@@ -1996,6 +2000,9 @@ weston_keyboard_send_keymap(struct weston_keyboard *kbd,
int
weston_compositor_load_xwayland(struct weston_compositor *compositor);
int
weston_compositor_load_color_manager(struct weston_compositor *compositor);
bool
weston_head_is_connected(struct weston_head *head);
......@@ -2074,9 +2081,6 @@ void
weston_output_set_transform(struct weston_output *output,
uint32_t transform);
bool
weston_output_set_renderer_shadow_buffer(struct weston_output *output);
void
weston_output_init(struct weston_output *output,
struct weston_compositor *compositor,
......
......@@ -50,7 +50,10 @@ if get_option('shell-ivi')
ivi_test_config = configuration_data()
ivi_test_config.set('bindir', dir_bin)
ivi_test_config.set('libexecdir', dir_libexec)
ivi_test_config.set('plugin_prefix', meson.current_build_dir())
ivi_test_config.set('westondatadir', join_paths(dir_data, 'weston'))
ivi_test_config.set('westondatadir', dir_data / 'weston')
configure_file(
input: 'weston.ini.in',
output: 'weston.ini',
configuration: ivi_test_config
)
endif
[core]
shell=ivi-shell.so
modules=hmi-controller.so
[ivi-shell]
ivi-shell-user-interface=weston-ivi-shell-user-interface
#developermode=true
cursor-theme=default
cursor-size=32
base-layer-id=1000
base-layer-id-offset=10000
workspace-background-layer-id=2000
workspace-layer-id=3000
application-layer-id=4000
transition-duration=300
background-image=@westondatadir@/background.png
background-id=1001
panel-image=@westondatadir@/panel.png
panel-id=1002
surface-id-offset=10
tiling-image=@westondatadir@/tiling.png
tiling-id=1003
sidebyside-image=@westondatadir@/sidebyside.png
sidebyside-id=1004
fullscreen-image=@westondatadir@/fullscreen.png
fullscreen-id=1005
random-image=@westondatadir@/random.png
random-id=1006
home-image=@westondatadir@/home.png
home-id=1007
workspace-background-color=0x99000000
workspace-background-id=2001
[ivi-launcher]
workspace-id=0
icon-id=4001
icon=@westondatadir@/icon_ivi_flower.png
path=@bindir@/weston-flower
[ivi-launcher]
workspace-id=0
icon-id=4002
icon=@westondatadir@/icon_ivi_clickdot.png
path=@bindir@/weston-clickdot
[ivi-launcher]
workspace-id=1
icon-id=4003
icon=@westondatadir@/icon_ivi_simple-egl.png
path=@bindir@/weston-simple-egl
[ivi-launcher]
workspace-id=1
icon-id=4004
icon=@westondatadir@/icon_ivi_simple-shm.png
path=@bindir@/weston-simple-shm
[ivi-launcher]
workspace-id=2
icon-id=4005
icon=@westondatadir@/icon_ivi_smoke.png
path=@bindir@/weston-smoke
[ivi-launcher]
workspace-id=3
icon-id=4006
icon=@westondatadir@/icon_ivi_flower.png
path=@bindir@/weston-flower
[ivi-launcher]
workspace-id=3
icon-id=4007
icon=@westondatadir@/icon_ivi_clickdot.png
path=@bindir@/weston-clickdot
[ivi-launcher]
workspace-id=3
icon-id=4008
icon=@westondatadir@/icon_ivi_simple-egl.png
path=@bindir@/weston-simple-egl
[ivi-launcher]
workspace-id=3
icon-id=4009
icon=@westondatadir@/icon_ivi_simple-shm.png
path=@bindir@/weston-simple-shm
[ivi-launcher]
workspace-id=3
icon-id=4010
icon=@westondatadir@/icon_ivi_smoke.png
path=@bindir@/weston-smoke
......@@ -511,6 +511,7 @@ struct drm_output {
struct drm_fb *gbm_cursor_fb[2];
struct drm_plane *cursor_plane;
struct weston_view *cursor_view;
struct wl_listener cursor_view_destroy_listener;
int current_cursor;
struct gbm_surface *gbm_surface;
......@@ -688,6 +689,9 @@ struct drm_fb *
drm_fb_get_from_bo(struct gbm_bo *bo, struct drm_backend *backend,
bool is_opaque, enum drm_fb_type type);
void
drm_output_set_cursor_view(struct drm_output *output, struct weston_view *ev);
#ifdef BUILD_DRM_GBM
extern struct drm_fb *
drm_fb_get_from_view(struct drm_output_state *state, struct weston_view *ev);
......
......@@ -1793,6 +1793,8 @@ drm_output_destroy(struct weston_output *base)
return;
}
drm_output_set_cursor_view(output, NULL);
if (output->base.enabled)
drm_output_deinit(&output->base);
......
......@@ -669,7 +669,7 @@ drm_output_apply_state_legacy(struct drm_output_state *state)
* cursor plane set up.
*/
if (output->base.disable_planes) {
output->cursor_view = NULL;
drm_output_set_cursor_view(output, NULL);
if (output->cursor_plane) {
output->cursor_plane->base.x = INT32_MIN;
output->cursor_plane->base.y = INT32_MIN;
......@@ -777,7 +777,7 @@ drm_output_apply_state_legacy(struct drm_output_state *state)
return 0;
err:
output->cursor_view = NULL;
drm_output_set_cursor_view(output, NULL);
drm_output_state_free(state);
return -1;
}
......
......@@ -38,6 +38,7 @@
#include "drm-internal.h"
#include "color.h"
#include "linux-dmabuf.h"
#include "presentation-time-server-protocol.h"
......@@ -380,7 +381,7 @@ drm_output_prepare_cursor_view(struct drm_output_state *output_state,
needs_update = true;
}
output->cursor_view = ev;
drm_output_set_cursor_view(output, ev);
plane_state->ev = ev;
plane_state->fb =
......@@ -882,6 +883,13 @@ drm_output_propose_state(struct weston_output *output_base,
continue;
}
/* Cannot show anything without a color transform. */
if (!pnode->surf_xform_valid) {
drm_debug(b, "\t\t\t\t[view] ignoring view %p "
"(color transform failed)\n", ev);
continue;
}
/* Ignore views we know to be totally occluded. */
pixman_region32_init(&clipped_view);
pixman_region32_intersect(&clipped_view,
......@@ -917,6 +925,13 @@ drm_output_propose_state(struct weston_output *output_base,
force_renderer = true;
}
if (pnode->surf_xform.transform != NULL ||
!pnode->surf_xform.identity_pipeline) {
drm_debug(b, "\t\t\t\t[view] not assigning view %p to plane "
"(requires color transform)\n", ev);
force_renderer = true;
}
/* Since we process views from top to bottom, we know that if
* the view intersects the calculated renderer region, it must
* be part of, or occluded by, it, and cannot go on a plane. */
......@@ -1141,6 +1156,41 @@ drm_assign_planes(struct weston_output *output_base, void *repaint_data)
drm_output_state_get_existing_plane(state,
output->cursor_plane);
if (!plane_state || !plane_state->fb)
output->cursor_view = NULL;
drm_output_set_cursor_view(output, NULL);
}
}
static void
drm_output_handle_cursor_view_destroy(struct wl_listener *listener, void *data)
{
struct drm_output *output =
container_of(listener, struct drm_output,
cursor_view_destroy_listener);
drm_output_set_cursor_view(output, NULL);
}
/** Set the current cursor view used for an output.
*
* Ensure the stored value will be properly cleared if the view is destroyed.
* The stored cursor view helps avoid unnecessary uploads of cursor data to
* cursor plane buffer objects (see drm_output_prepare_cursor_view).
*/
void
drm_output_set_cursor_view(struct drm_output *output, struct weston_view *ev)
{
if (output->cursor_view == ev)
return;
if (output->cursor_view)
wl_list_remove(&output->cursor_view_destroy_listener.link);
output->cursor_view = ev;
if (ev) {
output->cursor_view_destroy_listener.notify =
drm_output_handle_cursor_view_destroy;
wl_signal_add(&ev->destroy_signal,
&output->cursor_view_destroy_listener);
}
}
/*
* Copyright 2021 Collabora, Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "config.h"
#include <lcms2.h>
#include <libweston/libweston.h>
#include "color.h"
#include "color-lcms.h"
#include "shared/helpers.h"
static void
cmlcms_destroy_color_transform(struct weston_color_transform *xform_base)
{
}
static bool
cmlcms_get_surface_color_transform(struct weston_color_manager *cm_base,
struct weston_surface *surface,
struct weston_output *output,
struct weston_surface_color_transform *surf_xform)
{
/* Identity transform */
surf_xform->transform = NULL;
surf_xform->identity_pipeline = true;
return true;
}
static bool
cmlcms_get_output_color_transform(struct weston_color_manager *cm_base,
struct weston_output *output,
struct weston_color_transform **xform_out)
{
/* Identity transform */
*xform_out = NULL;
return true;
}
static bool
cmlcms_get_sRGB_to_output_color_transform(struct weston_color_manager *cm_base,
struct weston_output *output,
struct weston_color_transform **xform_out)
{
/* Identity transform */
*xform_out = NULL;
return true;
}
static bool
cmlcms_get_sRGB_to_blend_color_transform(struct weston_color_manager *cm_base,
struct weston_output *output,
struct weston_color_transform **xform_out)
{
/* Identity transform */
*xform_out = NULL;
return true;
}
static bool
cmlcms_init(struct weston_color_manager *cm_base)
{
if (!(cm_base->compositor->capabilities & WESTON_CAP_COLOR_OPS)) {
weston_log("color-lcms: error: color operations capability missing. Is GL-renderer not in use?\n");
return false;
}
return true;
}
static void
cmlcms_destroy(struct weston_color_manager *cm_base)
{
struct weston_color_manager_lcms *cmlcms = get_cmlcms(cm_base);
free(cmlcms);
}
WL_EXPORT struct weston_color_manager *
weston_color_manager_create(struct weston_compositor *compositor)
{
struct weston_color_manager_lcms *cm;
cm = zalloc(sizeof *cm);
if (!cm)
return NULL;
cm->base.name = "work-in-progress";
cm->base.compositor = compositor;
cm->base.supports_client_protocol = true;
cm->base.init = cmlcms_init;
cm->base.destroy = cmlcms_destroy;
cm->base.destroy_color_transform = cmlcms_destroy_color_transform;
cm->base.get_surface_color_transform =
cmlcms_get_surface_color_transform;
cm->base.get_output_color_transform = cmlcms_get_output_color_transform;
cm->base.get_sRGB_to_output_color_transform =
cmlcms_get_sRGB_to_output_color_transform;
cm->base.get_sRGB_to_blend_color_transform =
cmlcms_get_sRGB_to_blend_color_transform;
return &cm->base;
}
/*
* Copyright 2021 Collabora, Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef WESTON_COLOR_LCMS_H
#define WESTON_COLOR_LCMS_H
#include <libweston/libweston.h>
#include "color.h"
#include "shared/helpers.h"
struct weston_color_manager_lcms {
struct weston_color_manager base;
};
static inline struct weston_color_manager_lcms *
get_cmlcms(struct weston_color_manager *cm_base)
{
return container_of(cm_base, struct weston_color_manager_lcms, base);
}
#endif /* WESTON_COLOR_LCMS_H */
if not get_option('color-management-lcms')
subdir_done()
endif
dep_lcms2 = dependency('lcms2', version: '>= 2.9', required: false)
if not dep_lcms2.found()
error('color-lcms plugin requires lcms2 which was not found. Or, you can use \'-Dcolor-management-lcms=false\'.')
endif
srcs_color_lcms = [
'color-lcms.c',
]
deps_color_lcms = [
dep_libm,
dep_libweston_private,
dep_lcms2,
]
plugin_color_lcms = shared_library(
'color-lcms',
srcs_color_lcms,
include_directories: common_inc,
dependencies: deps_color_lcms,
name_prefix: '',
install: true,
install_dir: dir_module_libweston
)
env_modmap += 'color-lcms.so=@0@;'.format(plugin_color_lcms.full_path())
/*
* Copyright 2021 Collabora, Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "config.h"
#include <libweston/libweston.h>
#include "color.h"
#include "shared/helpers.h"
struct weston_color_manager_noop {
struct weston_color_manager base;
};
static struct weston_color_manager_noop *
get_cmnoop(struct weston_color_manager *cm_base)
{
return container_of(cm_base, struct weston_color_manager_noop, base);
}
static void
cmnoop_destroy_color_transform(struct weston_color_transform *xform)
{
/* Never called, as never creates an actual color transform. */
}
static bool
cmnoop_get_surface_color_transform(struct weston_color_manager *cm_base,
struct weston_surface *surface,
struct weston_output *output,
struct weston_surface_color_transform *surf_xform)
{
/* TODO: Assert surface has no colorspace set */
/* TODO: Assert output has no colorspace set */
/* Identity transform */
surf_xform->transform = NULL;
surf_xform->identity_pipeline = true;
return true;
}
static bool
cmnoop_get_output_color_transform(struct weston_color_manager *cm_base,
struct weston_output *output,
struct weston_color_transform **xform_out)
{
/* TODO: Assert output has no colorspace set */
/* Identity transform */
*xform_out = NULL;
return true;
}
static bool
cmnoop_get_sRGB_to_output_color_transform(struct weston_color_manager *cm_base,
struct weston_output *output,
struct weston_color_transform **xform_out)
{
/* TODO: Assert output has no colorspace set */
/* Identity transform */
*xform_out = NULL;
return true;
}
static bool
cmnoop_get_sRGB_to_blend_color_transform(struct weston_color_manager *cm_base,
struct weston_output *output,
struct weston_color_transform **xform_out)
{
/* TODO: Assert output has no colorspace set */
/* Identity transform */
*xform_out = NULL;
return true;
}
static bool
cmnoop_init(struct weston_color_manager *cm_base)
{
/* No renderer requirements to check. */
/* Nothing to initialize. */
return true;
}
static void
cmnoop_destroy(struct weston_color_manager *cm_base)
{
struct weston_color_manager_noop *cmnoop = get_cmnoop(cm_base);
free(cmnoop);
}
struct weston_color_manager *
weston_color_manager_noop_create(struct weston_compositor *compositor)
{
struct weston_color_manager_noop *cm;
cm = zalloc(sizeof *cm);
if (!cm)
return NULL;
cm->base.name = "no-op";
cm->base.compositor = compositor;
cm->base.supports_client_protocol = false;
cm->base.init = cmnoop_init;
cm->base.destroy = cmnoop_destroy;
cm->base.destroy_color_transform = cmnoop_destroy_color_transform;
cm->base.get_surface_color_transform =
cmnoop_get_surface_color_transform;
cm->base.get_output_color_transform = cmnoop_get_output_color_transform;
cm->base.get_sRGB_to_output_color_transform =
cmnoop_get_sRGB_to_output_color_transform;
cm->base.get_sRGB_to_blend_color_transform =
cmnoop_get_sRGB_to_blend_color_transform;
return &cm->base;
}
/*
* Copyright 2021 Collabora, Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "config.h"
#include <libweston/libweston.h>
#include <assert.h>
#include "color.h"
#include "libweston-internal.h"
/**
* Increase reference count of the color transform object
*
* \param xform The color transform. NULL is accepted too.
* \return xform.
*/
WL_EXPORT struct weston_color_transform *
weston_color_transform_ref(struct weston_color_transform *xform)
{
/* NULL is a valid color transform: identity */
if (!xform)
return NULL;
assert(xform->ref_count > 0);
xform->ref_count++;
return xform;
}
/**
* Decrease and potentially destroy the color transform object
*
* \param xform The color transform. NULL is accepted too.
*/
WL_EXPORT void
weston_color_transform_unref(struct weston_color_transform *xform)
{
if (!xform)
return;
assert(xform->ref_count > 0);
if (--xform->ref_count > 0)
return;
wl_signal_emit(&xform->destroy_signal, xform);
xform->cm->destroy_color_transform(xform);
}
/**
* Initializes a newly allocated color transform object
*
* This is used only by color managers. They sub-class weston_color_transform.
*
* The reference count starts at 1.
*
* To destroy a weston_color_transform, use weston_color_transfor_unref().
*/
WL_EXPORT void
weston_color_transform_init(struct weston_color_transform *xform,
struct weston_color_manager *cm)
{
xform->cm = cm;
xform->ref_count = 1;
wl_signal_init(&xform->destroy_signal);
}
/** Deep copy */
void
weston_surface_color_transform_copy(struct weston_surface_color_transform *dst,
const struct weston_surface_color_transform *src)
{
*dst = *src;
dst->transform = weston_color_transform_ref(src->transform);
}
/** Unref contents */
void
weston_surface_color_transform_fini(struct weston_surface_color_transform *surf_xform)
{
weston_color_transform_unref(surf_xform->transform);
}
/**
* Ensure that the surface's color transformation for the given output is
* populated in the paint nodes for all the views.
*
* Creates the color transformation description if necessary by calling
* into the color manager.
*
* \param pnode Paint node defining the surface and the output. All
* paint nodes with the same surface and output will be ensured.
*/
void
weston_paint_node_ensure_color_transform(struct weston_paint_node *pnode)
{
struct weston_surface *surface = pnode->surface;
struct weston_output *output = pnode->output;
struct weston_color_manager *cm = surface->compositor->color_manager;
struct weston_surface_color_transform surf_xform = {};
struct weston_paint_node *it;
bool ok;
/*
* Invariant: all paint nodes with the same surface+output have the
* same surf_xform state.
*/
if (pnode->surf_xform_valid)
return;
ok = cm->get_surface_color_transform(cm, surface, output, &surf_xform);
wl_list_for_each(it, &surface->paint_node_list, surface_link) {
if (it->output == output) {
assert(it->surf_xform_valid == false);
assert(it->surf_xform.transform == NULL);
weston_surface_color_transform_copy(&it->surf_xform,
&surf_xform);
it->surf_xform_valid = ok;
}
}
weston_surface_color_transform_fini(&surf_xform);
if (!ok) {
if (surface->resource)
wl_resource_post_no_memory(surface->resource);
weston_log("Failed to create color transformation for a surface.\n");
}
}
/*
* Copyright 2021 Collabora, Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef WESTON_COLOR_H
#define WESTON_COLOR_H
#include <stdbool.h>
#include <libweston/libweston.h>
/** Type or formula for a curve */
enum weston_color_curve_type {
/** Identity function, no-op */
WESTON_COLOR_CURVE_TYPE_IDENTITY = 0,
/** Three-channel, one-dimensional look-up table */
WESTON_COLOR_CURVE_TYPE_LUT_3x1D,
};
/** LUT_3x1D parameters */
struct weston_color_curve_lut_3x1d {
/* To be defined */
};
/**
* A scalar function for color encoding and decoding
*
* This object can represent a one-dimensional function that is applied
* independently to each of the color channels. Depending on the type and
* parameterization of the curve, all color channels may use the
* same function or each may have separate parameters.
*
* This is usually used for EOTF or EOTF^-1 and to optimize a 3D LUT size
* without sacrificing precision, both in one step.
*/
struct weston_color_curve {
/** Which member of 'u' defines the curve. */
enum weston_color_curve_type type;
/** Parameters for the curve. */
union {
/* identity: no parameters */
struct weston_color_curve_lut_3x1d lut_3x1d;
} u;
};
/**
* Describes a color transformation formula
*
* Guaranteed unique, de-duplicated.
*
* Sub-classed by the color manager that created this.
*
* For a renderer to support WESTON_CAP_COLOR_OPS it must implement everything
* that this structure can represent.
*/
struct weston_color_transform {
struct weston_color_manager *cm;
int ref_count;
/* for renderer or backend to attach their own cached objects */
struct wl_signal destroy_signal;
/* Color transform is the series of steps: */
/** Step 1: color model change */
/* YCbCr→RGB conversion, but that is done elsewhere */
/** Step 2: color curve before color mapping */
struct weston_color_curve pre_curve;
/** Step 3: color mapping */
/* TBD: e.g. a 3D LUT or a matrix */
/** Step 4: color curve after color mapping */
/* struct weston_color_curve post_curve; */
};
/**
* How content color needs to be transformed
*
* This object is specific to the color properties of the weston_surface and
* weston_output it was created for. It is automatically destroyed if any
* relevant color properties change.
*
* Fundamentally this contains the color transformation from content color
* space to an output's blending color space. This is stored in field
* 'transform' with NULL value corresponding to identity transformation.
*
* For graphics pipeline optimization purposes, the field 'identity_pipeline'
* indicates whether the combination of 'transform' here and the output's
* blending color space to monitor color space transformation total to
* identity transformation. This helps detecting cases where renderer bypass
* (direct scanout) is possible.
*/
struct weston_surface_color_transform {
/** Transformation from source to blending space */
struct weston_color_transform *transform;
/** True, if source colorspace is identical to monitor color space */
bool identity_pipeline;
};
struct weston_color_manager {
/** Identifies this CMS component */
const char *name;
/** This compositor instance */
struct weston_compositor *compositor;
/** Supports the Wayland CM&HDR protocol extension? */
bool supports_client_protocol;
/** Initialize color manager */
bool
(*init)(struct weston_color_manager *cm);
/** Destroy color manager */
void
(*destroy)(struct weston_color_manager *cm);
/** Destroy a color transform after refcount fell to zero */
void
(*destroy_color_transform)(struct weston_color_transform *xform);
/** Get surface to output's blending space transformation
*
* \param cm The color manager.
* \param surface The surface for the source color space.
* \param output The output for the destination blending color space.
* \param surf_xform For storing the color transformation and
* additional information.
*
* The callee is responsible for increasing the reference count on the
* weston_color_transform it stores into surf_xform.
*/
bool
(*get_surface_color_transform)(struct weston_color_manager *cm,
struct weston_surface *surface,
struct weston_output *output,
struct weston_surface_color_transform *surf_xform);
/** Get output's blending space to output transformation
*
* \param cm The color manager.
* \param output The output for the destination color space.
* \param xform_out Pointer for storing the weston_color_transform.
* \return True on success, false on failure.
*
* The callee is responsible for increasing the reference count on the
* weston_color_transform it stores via xform_out. On failure, xform_out
* is untouched.
*/
bool
(*get_output_color_transform)(struct weston_color_manager *cm,
struct weston_output *output,
struct weston_color_transform **xform_out);
/** Get sRGB to output transformation
*
* \param cm The color manager.
* \param output The output for the destination color space.
* \param xform_out Pointer for storing the weston_color_transform.
* \return True on success, false on failure.
*
* The callee is responsible for increasing the reference count on the
* weston_color_transform it stores via xform_out. On failure, xform_out
* is untouched.
*/
bool
(*get_sRGB_to_output_color_transform)(struct weston_color_manager *cm,
struct weston_output *output,
struct weston_color_transform **xform_out);
/** Get sRGB to output's blending space transformation
*
* \param cm The color manager.
* \param output The output for the destination blending color space.
* \param xform_out Pointer for storing the weston_color_transform.
* \return True on success, false on failure.
*
* The callee is responsible for increasing the reference count on the
* weston_color_transform it stores via xform_out. On failure, xform_out
* is untouched.
*/
bool
(*get_sRGB_to_blend_color_transform)(struct weston_color_manager *cm,
struct weston_output *output,
struct weston_color_transform **xform_out);
};
struct weston_color_transform *
weston_color_transform_ref(struct weston_color_transform *xform);
void
weston_color_transform_unref(struct weston_color_transform *xform);
void
weston_color_transform_init(struct weston_color_transform *xform,
struct weston_color_manager *cm);
void
weston_surface_color_transform_copy(struct weston_surface_color_transform *dst,
const struct weston_surface_color_transform *src);
void
weston_surface_color_transform_fini(struct weston_surface_color_transform *surf_xform);
struct weston_paint_node;
void
weston_paint_node_ensure_color_transform(struct weston_paint_node *pnode);
struct weston_color_manager *
weston_color_manager_noop_create(struct weston_compositor *compositor);
/* DSO module entrypoint */
struct weston_color_manager *
weston_color_manager_create(struct weston_compositor *compositor);
#endif /* WESTON_COLOR_H */
......@@ -74,6 +74,7 @@
#include "pixel-formats.h"
#include "backend.h"
#include "libweston-internal.h"
#include "color.h"
#include "weston-log-internal.h"
......@@ -105,6 +106,7 @@ weston_paint_node_create(struct weston_surface *surface,
struct weston_output *output)
{
struct weston_paint_node *pnode;
struct weston_paint_node *existing_node;
assert(view->surface == surface);
......@@ -112,6 +114,21 @@ weston_paint_node_create(struct weston_surface *surface,
if (!pnode)
return NULL;
/*
* Invariant: all paint nodes with the same surface+output have the
* same surf_xform state.
*/
wl_list_for_each(existing_node, &view->paint_node_list, view_link) {
assert(existing_node->surface == surface);
if (existing_node->output != output)
continue;
weston_surface_color_transform_copy(&pnode->surf_xform,
&existing_node->surf_xform);
pnode->surf_xform_valid = existing_node->surf_xform_valid;
break;
}
pnode->surface = surface;
wl_list_insert(&surface->paint_node_list, &pnode->surface_link);
......@@ -134,6 +151,8 @@ weston_paint_node_destroy(struct weston_paint_node *pnode)
wl_list_remove(&pnode->view_link);
wl_list_remove(&pnode->output_link);
wl_list_remove(&pnode->z_order_link);
assert(pnode->surf_xform_valid || !pnode->surf_xform.transform);
weston_surface_color_transform_fini(&pnode->surf_xform);
free(pnode);
}
......@@ -2695,6 +2714,12 @@ add_to_z_order_list(struct weston_output *output,
wl_list_remove(&pnode->z_order_link);
wl_list_insert(output->paint_node_z_order_list.prev,
&pnode->z_order_link);
/*
* Building weston_output::paint_node_z_order_list ensures all
* necessary color transform objects are installed.
*/
weston_paint_node_ensure_color_transform(pnode);
}
static void
......@@ -6244,6 +6269,17 @@ weston_output_transform_coordinate(struct weston_output *output,
*y = p.f[1] / p.f[3];
}
static void
weston_output_reset_color_transforms(struct weston_output *output)
{
weston_color_transform_unref(output->from_sRGB_to_output);
output->from_sRGB_to_output = NULL;
weston_color_transform_unref(output->from_sRGB_to_blend);
output->from_sRGB_to_blend = NULL;
weston_color_transform_unref(output->from_blend_to_output);
output->from_blend_to_output = NULL;
}
/** Removes output from compositor's list of enabled outputs
*
* \param output The weston_output object that is being removed.
......@@ -6255,6 +6291,8 @@ weston_output_transform_coordinate(struct weston_output *output,
* - The output assignments of all views in the current scenegraph are
* recomputed.
*
* - Destroys output's color transforms.
*
* - Presentation feedback is discarded.
*
* - Compositor is notified that outputs were changed and
......@@ -6299,6 +6337,8 @@ weston_compositor_remove_output(struct weston_output *output)
weston_view_assign_output(view);
}
weston_output_reset_color_transforms(output);
weston_presentation_feedback_discard_list(&output->feedback_list);
weston_compositor_reflow_outputs(compositor, output, -output->width);
......@@ -6424,39 +6464,6 @@ weston_output_set_transform(struct weston_output *output,
}
}
/** Make the output use renderer shadow buffer.
*
* \param output The weston_output object to modify.
* \return True on success, false if unsupported.
*
* This can only be set on a disabled output object.
*
* This is a temporary API to demonstrate WESTON_CAP_COLOR_OPS and allow
* testing related features. This will be superseded with color management
* API.
*
* By default, a renderer is not using a shadow buffer of its own. Enabling
* a shadow buffer may enable other color related features.
*
* Support depends on the chosen renderer and the graphics driver stack in use.
*
* \ingroup output
*/
WL_EXPORT bool
weston_output_set_renderer_shadow_buffer(struct weston_output *output)
{
struct weston_compositor *compositor = output->compositor;
assert(!output->enabled);
if (compositor->capabilities & WESTON_CAP_COLOR_OPS) {
output->use_renderer_shadow_buffer = true;
return true;
}
return false;
}
/** Initializes a weston_output object with enough data so
** an output can be configured.
*
......@@ -6588,10 +6595,12 @@ WL_EXPORT int
weston_output_enable(struct weston_output *output)
{
struct weston_compositor *c = output->compositor;
struct weston_color_manager *cm = c->color_manager;
struct weston_output *iterator;
struct weston_head *head;
char *head_names;
int x = 0, y = 0;
bool ok;
if (output->enabled) {
weston_log("Error: attempt to enable an enabled output '%s'\n",
......@@ -6647,12 +6656,27 @@ weston_output_enable(struct weston_output *output)
wl_list_init(&output->paint_node_list);
wl_list_init(&output->paint_node_z_order_list);
ok = cm->get_output_color_transform(cm, output,
&output->from_blend_to_output);
ok = ok && cm->get_sRGB_to_output_color_transform(cm, output,
&output->from_sRGB_to_output);
ok = ok && cm->get_sRGB_to_blend_color_transform(cm, output,
&output->from_sRGB_to_blend);
if (!ok) {
weston_log("Creating color transformation for output \"%s\" failed.\n",
output->name);
weston_output_reset_color_transforms(output);
return -1;
}
output->from_blend_to_output_by_backend = false;
/* Enable the output (set up the crtc or create a
* window representing the output, set up the
* renderer, etc)
*/
if (output->enable(output) < 0) {
weston_log("Enabling output \"%s\" failed.\n", output->name);
weston_output_reset_color_transforms(output);
return -1;
}
......@@ -7743,6 +7767,12 @@ weston_compositor_shutdown(struct weston_compositor *ec)
wl_list_for_each_safe(output, next, &ec->pending_output_list, link)
output->destroy(output);
/* Color manager objects may have renderer hooks */
if (ec->color_manager) {
ec->color_manager->destroy(ec->color_manager);
ec->color_manager = NULL;
}
if (ec->renderer)
ec->renderer->destroy(ec);
......@@ -8172,6 +8202,19 @@ weston_compositor_load_backend(struct weston_compositor *compositor,
return -1;
}
if (!compositor->color_manager) {
compositor->color_manager =
weston_color_manager_noop_create(compositor);
}
if (!compositor->color_manager)
return -1;
if (!compositor->color_manager->init(compositor->color_manager))
return -1;
weston_log("Color manager: %s\n", compositor->color_manager->name);
return 0;
}
......@@ -8191,6 +8234,41 @@ weston_compositor_load_xwayland(struct weston_compositor *compositor)
return 0;
}
/** Load Little CMS color manager plugin
*
* Calling this function before loading any backend sets Little CMS
* as the active color matching module (CMM) instead of the default no-op
* color manager.
*
* \ingroup compositor
*/
WL_EXPORT int
weston_compositor_load_color_manager(struct weston_compositor *compositor)
{
struct weston_color_manager *
(*cm_create)(struct weston_compositor *compositor);
if (compositor->color_manager) {
weston_log("Error: Color manager '%s' is loaded, cannot load another.\n",
compositor->color_manager->name);
return -1;
}
cm_create = weston_load_module("color-lcms.so", "weston_color_manager_create");
if (!cm_create) {
weston_log("Error: Could not load color-lcms.so.\n");
return -1;
}
compositor->color_manager = cm_create(compositor);
if (!compositor->color_manager) {
weston_log("Error: loading color-lcms.so failed.\n");
return -1;
}
return 0;
}
/** Resolve an internal compositor error by disconnecting the client.
*
* This function is used in cases when the wl_buffer turns out
......
......@@ -2749,7 +2749,7 @@ pointer_set_cursor(struct wl_client *client, struct wl_resource *resource,
pointer->hotspot_x = x;
pointer->hotspot_y = y;
if (surface->buffer_ref.buffer) {
if (surface->width != 0) {
pointer_cursor_surface_committed(surface, 0, 0);
weston_view_schedule_repaint(pointer->sprite);
}
......
......@@ -41,6 +41,7 @@
*/
#include <libweston/libweston.h>
#include "color.h"
/* weston_buffer */
......@@ -260,7 +261,6 @@ weston_surface_to_buffer_float(struct weston_surface *surface,
pixman_box32_t
weston_surface_to_buffer_rect(struct weston_surface *surface,
pixman_box32_t rect);
void
weston_surface_to_buffer_region(struct weston_surface *surface,
pixman_region32_t *surface_region,
......@@ -416,6 +416,9 @@ struct weston_paint_node {
/* struct weston_output::paint_node_z_order_list */
struct wl_list z_order_link;
struct weston_surface_color_transform surf_xform;
bool surf_xform_valid;
};
struct weston_paint_node *
......
......@@ -12,6 +12,8 @@ srcs_libweston = [
'animation.c',
'bindings.c',
'clipboard.c',
'color.c',
'color-noop.c',
'compositor.c',
'content-protection.c',
'data-device.c',
......@@ -244,6 +246,7 @@ if get_option('weston-launch')
meson.add_install_script('echo', 'REMINDER: You are installing weston-launch, please make it setuid-root.')
endif
subdir('color-lcms')
subdir('renderer-gl')
subdir('backend-drm')
subdir('backend-fbdev')
......
......@@ -33,6 +33,7 @@
#include <assert.h>
#include "pixman-renderer.h"
#include "color.h"
#include "shared/helpers.h"
#include <linux/input.h>
......@@ -471,26 +472,31 @@ draw_view_source_clipped(struct weston_view *view,
}
static void
draw_view(struct weston_view *ev, struct weston_output *output,
pixman_region32_t *damage) /* in global coordinates */
draw_paint_node(struct weston_paint_node *pnode,
pixman_region32_t *damage /* in global coordinates */)
{
struct pixman_surface_state *ps = get_surface_state(ev->surface);
struct pixman_surface_state *ps = get_surface_state(pnode->surface);
/* repaint bounding region in global coordinates: */
pixman_region32_t repaint;
if (!pnode->surf_xform_valid)
return;
assert(pnode->surf_xform.transform == NULL);
/* No buffer attached */
if (!ps->image)
return;
pixman_region32_init(&repaint);
pixman_region32_intersect(&repaint,
&ev->transform.boundingbox, damage);
pixman_region32_subtract(&repaint, &repaint, &ev->clip);
&pnode->view->transform.boundingbox, damage);
pixman_region32_subtract(&repaint, &repaint, &pnode->view->clip);
if (!pixman_region32_not_empty(&repaint))
goto out;
if (view_transformation_is_translation(ev)) {
if (view_transformation_is_translation(pnode->view)) {
/* The simple case: The surface regions opaque, non-opaque,
* etc. are convertible to global coordinate space.
* There is no need to use a source clip region.
......@@ -498,7 +504,7 @@ draw_view(struct weston_view *ev, struct weston_output *output,
* Also the boundingbox is accurate rather than an
* approximation.
*/
draw_view_translated(ev, output, &repaint);
draw_view_translated(pnode->view, pnode->output, &repaint);
} else {
/* The complex case: the view transformation does not allow
* converting opaque etc. regions into global coordinate space.
......@@ -507,7 +513,7 @@ draw_view(struct weston_view *ev, struct weston_output *output,
* to be used whole. Source clipping does not work with
* PIXMAN_OP_SRC.
*/
draw_view_source_clipped(ev, output, &repaint);
draw_view_source_clipped(pnode->view, pnode->output, &repaint);
}
out:
......@@ -522,7 +528,7 @@ repaint_surfaces(struct weston_output *output, pixman_region32_t *damage)
wl_list_for_each_reverse(pnode, &output->paint_node_z_order_list,
z_order_link) {
if (pnode->view->plane == &compositor->primary_plane)
draw_view(pnode->view, output, damage);
draw_paint_node(pnode, damage);
}
}
......@@ -560,6 +566,9 @@ pixman_renderer_repaint_output(struct weston_output *output,
struct pixman_output_state *po = get_output_state(output);
pixman_region32_t hw_damage;
assert(output->from_blend_to_output_by_backend ||
output->from_blend_to_output == NULL);
if (!po->hw_buffer) {
po->hw_extra_damage = NULL;
return;
......
......@@ -27,6 +27,9 @@
/* GLSL version 1.00 ES, defined in gl-shaders.c */
/* For annotating shader compile-time constant arguments */
#define compile_const const
/*
* Enumeration of shader variants, must match enum gl_shader_texture_variant.
*/
......@@ -49,8 +52,8 @@ precision mediump float;
* These undeclared identifiers will be #defined by a runtime generated code
* snippet.
*/
const int c_variant = DEF_VARIANT;
const bool c_green_tint = DEF_GREEN_TINT;
compile_const int c_variant = DEF_VARIANT;
compile_const bool c_green_tint = DEF_GREEN_TINT;
vec4
yuva2rgba(vec4 yuva)
......