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 (52)
Showing
with 692 additions and 206 deletions
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:
.templates_sha: &template_sha 567700e483aabed992d0a4fea84994a0472deff6 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
# This file uses the freedesktop ci-templates to build Weston and run our
# tests in CI.
#
# ci-templates uses a multi-stage build process. First, the base container
# image is built which contains the core distribution, the toolchain, and
# all our build dependencies. This container is aggressively cached; if a
# container image matching $FDO_DISTRIBUTION_TAG is found in either the
# upstream repo (wayland/weston) or the user's downstream repo, it is
# reused for the build. This gives us predictability of build and far
# quicker runtimes, however it means that any changes to the base container
# must also change $FDO_DISTRIBUTION_TAG. When changing this, please use
# the current date as well as a unique build identifier.
#
# After the container is either rebuilt (tag mismatch) or reused (tag
# previously used), the build stage executes within this container.
#
# The final stage is used to expose documentation and coverage information,
# including publishing documentation to the public site when built on the
# main branch.
#
# Apart from the 'variables', 'include', and 'stages' top-level anchors,
# everything not beginning with a dot ('.') is the name of a job which will
# be executed as part of CI, unless the rules specify that it should not be
# run.
#
# Variables prefixed with CI_ are generally provided by GitLab itself;
# variables prefixed with FDO_ and templates prefixed by .fdo are provided
# by the ci-templates.
#
# For more information on GitLab CI, including the YAML syntax, see:
# https://docs.gitlab.com/ee/ci/yaml/README.html
#
# Note that freedesktop.org uses the 'Community Edition' of GitLab, so features
# marked as 'premium' or 'ultimate' are not available to us.
#
# For more information on ci-templates, see:
# - documentation at https://freedesktop.pages.freedesktop.org/ci-templates/
# - repo at https://gitlab.freedesktop.org/freedesktop/ci-templates/
variables:
FDO_UPSTREAM_REPO: wayland/weston
FDO_REPO_SUFFIX: "$BUILD_OS/$BUILD_ARCH"
FDO_DISTRIBUTION_TAG: '2021-08-03.2-clang'
include:
# Here we use a fixed ref in order to isolate ourselves from ci-templates
# API changes. If you need new features from ci-templates you must bump
# this to the current SHA you require from the ci-templates repo, however
# be aware that you may need to account for API changes when doing so.
- project: 'freedesktop/ci-templates'
ref: 59de540b620c45739871d1a073d76d5521989d11
ref: *template_sha
file: '/templates/debian.yml'
- project: 'freedesktop/ci-templates'
ref: *template_sha
file: '/templates/ci-fairy.yml'
# Define the build stages. These are used for UI grouping as well as
# dependencies.
stages:
- container_prep
- build
- "Merge request checks"
- "Base container"
- "Full build and test"
- "No-GL build and test"
- "Other builds"
- pages
.debian:
# Base variables used for anything using a Debian environment
.os-debian:
variables:
BUILD_OS: debian
FDO_DISTRIBUTION_VERSION: buster
FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/debian-install.sh'
FDO_DISTRIBUTION_TAG: '2021-04-15.2'
FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} BUILD_ARCH=${BUILD_ARCH} KERNEL_IMAGE=${KERNEL_IMAGE} KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG} bash .gitlab-ci/debian-install.sh'
.ci-rules:
rules:
- when: on_success
# Does not inherit .ci-rules as we only want it to run in MR context.
check-commit:
extends:
- .fdo.ci-fairy
stage: "Merge request checks"
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: always
- when: never
script:
- ci-fairy check-commits --signed-off-by --junit-xml=results.xml
variables:
GIT_DEPTH: 100
artifacts:
reports:
junit: results.xml
.debian-x86_64:
extends:
- .os-debian
variables:
BUILD_ARCH: "x86-64"
KERNEL_IMAGE: "bzImage"
KERNEL_DEFCONFIG: "x86_64_defconfig"
.debian-armv7:
extends:
- .os-debian
variables:
BUILD_ARCH: "armv7"
.debian-aarch64:
extends:
- .os-debian
variables:
BUILD_ARCH: "aarch64"
KERNEL_IMAGE: "Image"
KERNEL_DEFCONFIG: "defconfig"
QEMU_SMP: 8 # built-in QEmu limit
# Build our base container image, which contains the core distribution, the
# toolchain, and all our build dependencies. This will be reused in the build
# stage.
x86_64-debian-container_prep:
extends:
- .ci-rules
- .debian-x86_64
- .fdo.container-build@debian
timeout: 30m
stage: "Base container"
container_prep:
armv7-debian-container_prep:
extends:
- .debian
- .ci-rules
- .debian-armv7
- .fdo.container-build@debian
tags:
- aarch64
variables:
FDO_BASE_IMAGE: "arm32v7/debian:$FDO_DISTRIBUTION_VERSION"
timeout: 30m
stage: container_prep
stage: "Base container"
aarch64-debian-container_prep:
extends:
- .ci-rules
- .debian-aarch64
- .fdo.container-build@debian
tags:
- aarch64
timeout: 30m
stage: "Base container"
# Core templates for all of our build steps. These are reused by all build jobs
# through the `extends` keyword.
.build-env:
extends:
- .debian
- .fdo.distribution-image@debian
timeout: 5m
stage: build
variables:
BUILDDIR: $CI_PROJECT_DIR/build-weston-$CI_JOB_NAME
PREFIX: $CI_PROJECT_DIR/prefix-weston-$CI_JOB_NAME
before_script:
- git clone --depth=1 https://gitlab.freedesktop.org/wayland/wayland-protocols
- export WAYLAND_PROTOCOLS_DIR="$(pwd)/prefix-wayland-protocols"
- export PKG_CONFIG_PATH="$WAYLAND_PROTOCOLS_DIR/share/pkgconfig:$PKG_CONFIG_PATH"
- export MAKEFLAGS="-j${FDO_CI_CONCURRENT:-4}"
- cd wayland-protocols
- git show -s HEAD
- mkdir build
- cd build
- ../autogen.sh --prefix="$WAYLAND_PROTOCOLS_DIR"
- make install
- cd ../../
- export PATH=~/.local/bin:$PATH
- export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
- export TESTS_RES_PATH="$BUILDDIR/tests-res.txt"
- mkdir "$BUILDDIR" "$PREFIX"
.build-with-clang:
variables:
CC: clang-8
CC_LD: lld-8
MESON_TOOLCHAIN_OPTIONS: "$MESON_OPTIONS -Db_lundef=false" # clang+ASan+undef=boom
# Extends the core build templates to also provide for running our testing. We
# run this inside a virtme (qemu wrapper) VM environment so we can test the DRM
# backend using the 'vkms' virtual driver under Linux.
.build-and-test:
extends: .build-env
tags:
- kvm
extends:
- .ci-rules
script:
- export PATH=~/.local/bin:$PATH
- cd "$BUILDDIR"
- meson --prefix="$PREFIX" -Db_sanitize=address ${MESON_OPTIONS} ..
- meson --prefix="$PREFIX" -Db_sanitize=address ${MESON_OPTIONS} ${MESON_TOOLCHAIN_OPTIONS} ..
- ninja -k0 -j${FDO_CI_CONCURRENT:-4}
- ninja install
- virtme-run --rw --pwd --kimg /weston-virtme/bzImage --kopt quiet --script-dir ../.gitlab-ci/virtme-scripts --qemu-opts -m 4096 -smp ${FDO_CI_CONCURRENT:-4}
- test -n "${QEMU_SMP}" || QEMU_SMP=${FDO_CI_CONCURRENT:-4}
- virtme-run --rw --pwd --kimg /weston-virtme/${KERNEL_IMAGE} --kopt quiet --script-dir ../.gitlab-ci/virtme-scripts --qemu-opts -m 4096 -smp ${QEMU_SMP}
- TEST_RES=$(cat $TESTS_RES_PATH)
- rm $TESTS_RES_PATH
- cp -R /weston-virtme ./
- rm weston-virtme/bzImage
- rm weston-virtme/${KERNEL_IMAGE}
- exit $TEST_RES
artifacts:
name: weston-$CI_COMMIT_SHA
......@@ -83,12 +202,11 @@ container_prep:
reports:
junit: $BUILDDIR/meson-logs/testlog.junit.xml
# Same as above, but without running any tests.
.build-no-test:
extends: .build-env
tags:
- kvm
extends:
- .ci-rules
script:
- export PATH=~/.local/bin:$PATH
- cd "$BUILDDIR"
- meson --prefix="$PREFIX" ${MESON_OPTIONS} ..
- ninja -k0 -j${FDO_CI_CONCURRENT:-4}
......@@ -101,7 +219,61 @@ container_prep:
- $BUILDDIR/meson-logs
- $PREFIX
build-full:
# OS/architecture-specific variants
.build-env-debian-x86_64:
extends:
- .debian-x86_64
- .fdo.suffixed-image@debian
- .build-env
needs:
- job: x86_64-debian-container_prep
artifacts: false
.build-env-debian-armv7:
tags:
- aarch64
extends:
- .debian-armv7
- .fdo.suffixed-image@debian
- .build-env
needs:
- job: armv7-debian-container_prep
artifacts: false
.build-env-debian-aarch64:
tags:
- aarch64
extends:
- .debian-aarch64
- .fdo.suffixed-image@debian
- .build-env
needs:
- job: aarch64-debian-container_prep
artifacts: false
.test-env-debian-x86_64:
tags:
- kvm
extends:
- .build-env-debian-x86_64
- .build-and-test
needs:
- job: x86_64-debian-container_prep
artifacts: false
.test-env-debian-aarch64:
tags:
- kvm-aarch64
extends:
- .build-env-debian-aarch64
- .build-and-test
needs:
- job: aarch64-debian-container_prep
artifacts: false
# Full build, used for testing under KVM.
.build-options-full:
stage: "Full build and test"
variables:
MESON_OPTIONS: >
-Doptimization=0
......@@ -109,7 +281,6 @@ build-full:
-Dwerror=true
-Dtest-skip-is-failure=true
-Dlauncher-libseat=true
extends: .build-and-test
after_script:
- ninja -C "$BUILDDIR" coverage-html > "$BUILDDIR/meson-logs/ninja-coverage-html.txt"
- ninja -C "$BUILDDIR" coverage-xml
......@@ -118,14 +289,43 @@ build-full:
reports:
cobertura: $BUILDDIR/meson-logs/coverage.xml
build-docs:
x86_64-debian-full-build:
extends:
- .test-env-debian-x86_64
- .build-options-full
aarch64-debian-full-build:
extends:
- .test-env-debian-aarch64
- .build-options-full
x86_64-clang-debian-full-build:
extends:
- .test-env-debian-x86_64
- .build-with-clang
- .build-options-full
aarch64-clang-debian-full-build:
extends:
- .test-env-debian-aarch64
- .build-with-clang
- .build-options-full
# Docs should be invariant on all architectures, so we only do it on Debian
# x86-64.
docs-build:
stage: "Other builds"
variables:
MESON_OPTIONS: >
-Dwerror=true
-Ddoc=true
extends: .build-no-test
extends:
- .build-env-debian-x86_64
- .build-no-test
build-no-gl:
# Building without gl-renderer, to make sure this keeps working.
.build-options-no-gl:
stage: "No-GL build and test"
variables:
MESON_OPTIONS: >
-Dsimple-clients=damage,im,shm,touch,dmabuf-v4l
......@@ -134,38 +334,84 @@ build-no-gl:
-Dpipewire=false
-Dwerror=true
-Dlauncher-libseat=true
extends: .build-and-test
x86_64-debian-no-gl-build:
extends:
- .test-env-debian-x86_64
- .build-options-no-gl
armv7-debian-no-gl-build:
extends:
- .build-env-debian-armv7
- .build-no-test
- .build-options-no-gl
armv7-clang-debian-no-gl-build:
extends:
- .build-env-debian-armv7
- .build-with-clang
- .build-no-test
- .build-options-no-gl
aarch64-debian-no-gl-build:
extends:
- .test-env-debian-aarch64
- .build-options-no-gl
# Expose docs and coverage reports, so we can show users any changes to these
# inside their merge requests, letting us check them before merge.
#
# This does not build the docs or coverage information itself, but just reuses
# the docs and coverage information from the x86-64 Debian builds as the
# canonical sources of coverage information; the docs themselves should be
# invariant across any architecture or OS.
docs-and-coverage:
extends:
- .ci-rules
- .debian-x86_64
- .fdo.suffixed-image@debian
stage: pages
needs:
- job: docs-build
artifacts: true
- job: x86_64-debian-full-build
artifacts: true
timeout: 5m
script:
- mv prefix-weston-build-docs/share/doc/weston Documentation
- mv build-weston-build-full/meson-logs/coveragereport Test_Coverage
- mv prefix-weston-docs-build/share/doc/weston Documentation
- mv build-weston-x86_64-debian-full-build/meson-logs/coveragereport Test_Coverage
- rm Test_Coverage/gcov.css
- cp doc/style/lcov-style.css Test_Coverage/gcov.css
- cp doc/style/*.png Test_Coverage/
- rm -rf build-* prefix-*
dependencies:
- build-docs
- build-full
artifacts:
expose_as: 'Documentation preview and test coverage report'
paths:
- Documentation/
- Test_Coverage/
# Generate the documentation for https://wayland.pages.freedesktop.org/weston/
# Anything under public/ is published to this URL.
#
# Does not inherit .ci-rules as it should only run in our default branch for
# the upstream repo.
pages:
extends:
- .debian-x86_64
- .fdo.suffixed-image@debian
stage: pages
timeout: 5m
dependencies:
- build-docs
needs:
- job: docs-build
artifacts: true
script:
- export PREFIX=$(pwd)/prefix-weston-build-docs
- export PREFIX=$(pwd)/prefix-weston-docs-build
- mkdir public
- cp -R $PREFIX/share/doc/weston/* public/
artifacts:
paths:
- public
only:
- main
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_PATH == "wayland/weston" && $CI_BUILD_REF_NAME == $CI_DEFAULT_BRANCH'
when: on_success
- when: never
#!/bin/bash
#
# Builds the dependencies required for any OS/architecture combination. See
# .gitlab-ci.yml for more information. This script is called from an
# OS-specific build scripts like debian-install.sh.
set -o xtrace -o errexit
# Set concurrency to an appropriate level for our shared runners, falling back
# to the conservative default form before we had this variable.
export MAKEFLAGS="-j${FDO_CI_CONCURRENT:-4}"
export NINJAFLAGS="-j${FDO_CI_CONCURRENT:-4}"
# Build and install Meson. Generally we want to keep this in sync with what
# we require inside meson.build, however we require at least 0.57.0 per
# wayland/weston@bcf37c937a36, and 0.57.1 to fix the TAP parser when a test
# exits unsuccessfully
pip3 install --user git+https://github.com/mesonbuild/meson.git@0.57.1
export PATH=$HOME/.local/bin:$PATH
# Our docs are built using Sphinx (top-level organisation and final HTML/CSS
# generation), Doxygen (parse structures/functions/comments from source code),
# Breathe (a bridge between Doxygen and Sphinx), and we use the Read the Docs
# theme for the final presentation.
pip3 install sphinx==2.1.0 --user
pip3 install breathe==4.13.0.post0 --user
pip3 install sphinx_rtd_theme==0.4.3 --user
# Build a Linux kernel for use in testing. We enable the VKMS module so we can
# predictably test the DRM backend in the absence of real hardware. We lock the
# version here so we see predictable results.
#
# To run this we use virtme, a QEMU wrapper: https://github.com/amluto/virtme
#
# virtme makes our lives easier by abstracting handling of the console,
# filesystem, etc, so we can pretend that the VM we execute in is actually
# just a regular container.
#
# The reason why we are using a fork here is that it adds a patch to have the
# --script-dir command line option. With that we can run scripts that are in a
# certain folder when virtme starts, which is necessary in our use case.
#
# The upstream also has some commands that could help us to reach the same
# results: --script-sh and --script-exec. Unfornutately they are not completely
# implemented yet, so we had some trouble to use them and it was becoming
# hackery.
#
# The fork pulls in this support from the original GitHub PR, rebased on top of
# a newer upstream version which fixes AArch64 support.
if [[ -n "$KERNEL_DEFCONFIG" ]]; then
git clone --depth=1 --branch=drm-next-2020-06-11-1 https://anongit.freedesktop.org/git/drm/drm.git linux
cd linux
if [[ "${BUILD_ARCH}" = "x86-64" ]]; then
LINUX_ARCH=x86
elif [[ "$BUILD_ARCH" = "aarch64" ]]; then
LINUX_ARCH=arm64
else
echo "Invalid or missing \$BUILD_ARCH"
exit 1
fi
if [[ -z "${KERNEL_DEFCONFIG}" ]]; then
echo "Invalid or missing \$KERNEL_DEFCONFIG"
exit
fi
if [[ -z "${KERNEL_IMAGE}" ]]; then
echo "Invalid or missing \$KERNEL_IMAGE"
exit
fi
make ARCH=${LINUX_ARCH} ${KERNEL_DEFCONFIG}
make ARCH=${LINUX_ARCH} kvmconfig
./scripts/config \
--enable CONFIG_DRM \
--enable CONFIG_DRM_KMS_HELPER \
--enable CONFIG_DRM_KMS_FB_HELPER \
--enable CONFIG_DRM_VKMS
make ARCH=${LINUX_ARCH} oldconfig
make ARCH=${LINUX_ARCH}
cd ..
mkdir /weston-virtme
mv linux/arch/${LINUX_ARCH}/boot/${KERNEL_IMAGE} /weston-virtme/
mv linux/.config /weston-virtme/.config
rm -rf linux
git clone https://github.com/fooishbar/virtme
cd virtme
git checkout -b snapshot 70e390c564cd09e0da287a7f2c04a6592e59e379
./setup.py install
cd ..
fi
# Build and install Wayland; keep this version in sync with our dependency
# in meson.build.
git clone --branch 1.18.0 --depth=1 https://gitlab.freedesktop.org/wayland/wayland
cd wayland
git show -s HEAD
mkdir build
meson build -Ddocumentation=false
ninja ${NINJAFLAGS} -C build install
cd ..
# Keep this version in sync with our dependency in meson.build. If you wish to
# raise a MR against custom protocol, please change this reference to clone
# your relevant tree, and make sure you bump $FDO_DISTRIBUTION_TAG.
git clone --branch 1.19 https://gitlab.freedesktop.org/wayland/wayland-protocols
cd wayland-protocols
git show -s HEAD
mkdir build
cd build
../autogen.sh
make install
cd ../../
rm -rf wayland-protocols
# Build and install our own version of Mesa. Debian provides a perfectly usable
# Mesa, however llvmpipe's rendering behaviour can change subtly over time.
# This doesn't work for our tests which expect pixel-precise reproduction, so
# we lock it to a set version for more predictability. If you need newer
# features from Mesa then bump this version and $FDO_DISTRIBUTION_TAG, however
# please be prepared for some of the tests to change output, which will need to
# be manually inspected for correctness.
git clone --single-branch --branch 20.3 --shallow-since='2020-12-15' https://gitlab.freedesktop.org/mesa/mesa.git mesa
cd mesa
git checkout -b snapshot mesa-20.3.1
meson build -Dauto_features=disabled \
-Dgallium-drivers=swrast -Dvulkan-drivers= -Ddri-drivers=
ninja ${NINJAFLAGS} -C build install
cd ..
rm -rf mesa
# PipeWire is used for remoting support. Unlike our other dependencies its
# behaviour will be stable, however as a pre-1.0 project its API is not yet
# stable, so again we lock it to a fixed version.
#
# ... the version chosen is 0.3.32 with a small Clang-specific build fix.
rm -rf pipewire
git clone --single-branch --branch master https://gitlab.freedesktop.org/pipewire/pipewire.git pipewire
cd pipewire
git checkout -b snapshot bf112940d0bf8f526dd6229a619c1283835b49c2
meson build
ninja ${NINJAFLAGS} -C build install
cd ..
rm -rf pipewire
# seatd lets us avoid the pain of handling VTs manually through weston-launch
# or open-coding TTY assignment within Weston. We use this for our tests using
# the DRM backend.
git clone --depth=1 --branch 0.5.0 https://git.sr.ht/~kennylevinsen/seatd
cd seatd
meson build -Dauto_features=disabled \
-Dseatd=enabled -Dlogind=enabled -Dserver=enabled \
-Dexamples=disabled -Dman-pages=disabled
ninja ${NINJAFLAGS} -C build install
cd ..
rm -rf seatd
#!/bin/bash
#
# Constructs the base container image used to build Weston within CI. Per the
# comment at the top of .gitlab-ci.yml, any changes in this file must bump the
# $FDO_DISTRIBUTION_TAG variable so we know the container has to be rebuilt.
set -o xtrace -o errexit
......@@ -20,7 +24,6 @@ MESA_DEV_PKGS="
llvm-8-dev
python-mako
python3-mako
wayland-protocols
"
# Needed for running the custom-built mesa
......@@ -34,6 +37,7 @@ apt-get -y --no-install-recommends install \
autoconf \
automake \
build-essential \
clang-8 \
curl \
doxygen \
gcovr \
......@@ -82,6 +86,8 @@ apt-get -y --no-install-recommends install \
libxcursor-dev \
libxkbcommon-dev \
libxml2-dev \
lld-8 \
llvm-8 \
mesa-common-dev \
ninja-build \
pkg-config \
......@@ -90,86 +96,18 @@ apt-get -y --no-install-recommends install \
qemu-system \
sysvinit-core \
xwayland \
$MESA_RUNTIME_PKGS
$MESA_DEV_PKGS \
$MESA_RUNTIME_PKGS \
$LINUX_DEV_PKGS \
apt-get -y --no-install-recommends -t buster-backports install \
freerdp2-dev
pip3 install --user git+https://github.com/mesonbuild/meson.git@0.57.0
export PATH=$HOME/.local/bin:$PATH
# for documentation
pip3 install sphinx==2.1.0 --user
pip3 install breathe==4.13.0.post0 --user
pip3 install sphinx_rtd_theme==0.4.3 --user
apt-get -y --no-install-recommends install $LINUX_DEV_PKGS
git clone --depth=1 --branch=drm-next-2020-06-11-1 https://anongit.freedesktop.org/git/drm/drm.git linux
cd linux
make x86_64_defconfig
make kvmconfig
./scripts/config --enable CONFIG_DRM_VKMS
make oldconfig
make -j8
cd ..
mkdir /weston-virtme
mv linux/arch/x86/boot/bzImage /weston-virtme/bzImage
mv linux/.config /weston-virtme/.config
rm -rf linux
# Actually build our dependencies ...
./.gitlab-ci/build-deps.sh
# Link to upstream virtme: https://github.com/amluto/virtme
#
# The reason why we are using a fork here is that it adds a patch to have the
# --script-dir command line option. With that we can run scripts that are in a
# certain folder when virtme starts, which is necessary in our use case.
#
# The upstream also has some commands that could help us to reach the same
# results: --script-sh and --script-exec. Unfornutately they are not completely
# implemented yet, so we had some trouble to use them and it was becoming
# hackery.
#
git clone https://github.com/ezequielgarcia/virtme
cd virtme
git checkout -b snapshot 69e3cb83b3405edc99fcf9611f50012a4f210f78
./setup.py install
cd ..
git clone --branch 1.18.0 --depth=1 https://gitlab.freedesktop.org/wayland/wayland
export MAKEFLAGS="-j4"
cd wayland
git show -s HEAD
mkdir build
cd build
../autogen.sh --disable-documentation
make install
cd ../../
apt-get -y --no-install-recommends install $MESA_DEV_PKGS
git clone --single-branch --branch 20.3 --shallow-since='2020-12-15' https://gitlab.freedesktop.org/mesa/mesa.git mesa
cd mesa
git checkout -b snapshot mesa-20.3.1
meson build -Dauto_features=disabled \
-Dgallium-drivers=swrast -Dvulkan-drivers= -Ddri-drivers=
ninja -C build install
cd ..
rm -rf mesa
rm -rf pipewire
git clone --single-branch --branch master https://gitlab.freedesktop.org/pipewire/pipewire.git pipewire
cd pipewire
git checkout -b snapshot db12f47505ddccb257acdc0fa2bb884aceb1b593
meson build
ninja -C build install
cd ..
rm -rf pipewire
git clone --depth=1 --branch 0.5.0 https://git.sr.ht/~kennylevinsen/seatd
cd seatd
meson build -Dauto_features=disabled \
-Dseatd=enabled -Dlogind=enabled -Dserver=enabled \
-Dexamples=disabled -Dman-pages=disabled
ninja -C build install
cd ..
rm -rf seatd
apt-get -y --autoremove purge $LINUX_DEV_PKGS
apt-get -y --autoremove purge $MESA_DEV_PKGS
# And remove packages which are only required for our build dependencies,
# which we don't need bloating the image whilst we build and run Weston.
apt-get -y --autoremove purge $LINUX_DEV_PKGS $MESA_DEV_PKGS
......@@ -23,7 +23,7 @@ while ! [ -e /run/seatd.sock ]; do sleep 0.1; done
# run the tests and save the exit status
# we give ourselves a very generous timeout multiplier due to ASan overhead
ASAN_OPTIONS=detect_leaks=0,atexit=1 meson test --timeout-multiplier 4
ASAN_OPTIONS=detect_leaks=0,atexit=1 meson test --no-rebuild --timeout-multiplier 4
TEST_RES=$?
# create a file to keep the result of this script:
......
......@@ -60,6 +60,8 @@ extern char **environ; /* defined by libc */
enum clock_format {
CLOCK_FORMAT_MINUTES,
CLOCK_FORMAT_SECONDS,
CLOCK_FORMAT_MINUTES_24H,
CLOCK_FORMAT_SECONDS_24H,
CLOCK_FORMAT_NONE
};
......@@ -464,6 +466,14 @@ panel_add_clock(struct panel *panel)
clock->format_string = "%a %b %d, %I:%M:%S %p";
clock->refresh_timer = 1;
break;
case CLOCK_FORMAT_MINUTES_24H:
clock->format_string = "%a %b %d, %H:%M";
clock->refresh_timer = 60;
break;
case CLOCK_FORMAT_SECONDS_24H:
clock->format_string = "%a %b %d, %H:%M:%S";
clock->refresh_timer = 1;
break;
case CLOCK_FORMAT_NONE:
assert(!"not reached");
}
......@@ -502,7 +512,7 @@ panel_resize_handler(struct widget *widget,
if (panel->clock_format == CLOCK_FORMAT_SECONDS)
w = 170;
else /* CLOCK_FORMAT_MINUTES */
else /* CLOCK_FORMAT_MINUTES and 24H versions */
w = 150;
if (horizontal)
......@@ -549,6 +559,8 @@ panel_configure(void *data,
width = 32;
break;
case CLOCK_FORMAT_MINUTES:
case CLOCK_FORMAT_MINUTES_24H:
case CLOCK_FORMAT_SECONDS_24H:
width = 150;
break;
case CLOCK_FORMAT_SECONDS:
......@@ -1460,7 +1472,7 @@ panel_add_launchers(struct panel *panel, struct desktop *desktop)
}
if (count == 0) {
char *name = file_name_with_datadir("terminal.png");
char *name = file_name_with_datadir("terminal.png");
/* add default launcher */
panel_add_launcher(panel,
......@@ -1505,6 +1517,10 @@ parse_clock_format(struct desktop *desktop, struct weston_config_section *s)
desktop->clock_format = CLOCK_FORMAT_MINUTES;
else if (strcmp(clock_format, "seconds") == 0)
desktop->clock_format = CLOCK_FORMAT_SECONDS;
else if (strcmp(clock_format, "minutes-24h") == 0)
desktop->clock_format = CLOCK_FORMAT_MINUTES_24H;
else if (strcmp(clock_format, "seconds-24h") == 0)
desktop->clock_format = CLOCK_FORMAT_SECONDS_24H;
else if (strcmp(clock_format, "none") == 0)
desktop->clock_format = CLOCK_FORMAT_NONE;
else
......
......@@ -416,9 +416,9 @@ data_source_dnd_finished(void *data, struct wl_data_source *source)
delete_item =
dnd_drag->dnd_action == WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE;
/* The operation is already finished, we can destroy all
* related data.
*/
/* The operation is already finished, we can destroy all
* related data.
*/
dnd_drag_destroy(dnd_drag, delete_item);
window_schedule_redraw(dnd->window);
}
......
......@@ -1124,9 +1124,9 @@ redraw_handler(struct widget *widget, void *data)
cairo_stroke(cr);
}
/* skip space glyph (RLE) we use as a placeholder of
the right half of a double-width character,
because RLE is not available in every font. */
/* skip space glyph (RLE) we use as a placeholder of
the right half of a double-width character,
because RLE is not available in every font. */
if (p_row[col].ch == 0x200B)
continue;
......
......@@ -2214,9 +2214,9 @@ widget_set_tooltip(struct widget *parent, char *entry, float x, float y)
if (parent->tooltip_count > 1)
return 0;
tooltip = malloc(sizeof *tooltip);
if (!tooltip)
return -1;
tooltip = malloc(sizeof *tooltip);
if (!tooltip)
return -1;
parent->tooltip = tooltip;
tooltip->parent = parent;
......
......@@ -175,7 +175,7 @@ xserver_cleanup(struct weston_process *process, int status)
wxw->api->xserver_exited(wxw->xwayland, status);
wxw->sigusr1_source = wl_event_loop_add_signal(loop, SIGUSR1,
handle_sigusr1, wxw);
handle_sigusr1, wxw);
wxw->client = NULL;
}
......
......@@ -183,8 +183,8 @@ exposay_pick(struct desktop_shell *shell, int x, int y)
{
struct exposay_surface *esurface;
if (exposay_is_animating(shell))
return;
if (exposay_is_animating(shell))
return;
wl_list_for_each(esurface, &shell->exposay.surface_list, link) {
if (x < esurface->x || x > esurface->x + esurface->width)
......
......@@ -2464,22 +2464,28 @@ desktop_surface_removed(struct weston_desktop_surface *desktop_surface,
weston_desktop_surface_unlink_view(shsurf->view);
if (weston_surface_is_mapped(surface) &&
shsurf->shell->win_close_animation_type == ANIMATION_FADE) {
pixman_region32_fini(&surface->pending.input);
pixman_region32_init(&surface->pending.input);
pixman_region32_fini(&surface->input);
pixman_region32_init(&surface->input);
weston_fade_run(shsurf->view, 1.0, 0.0, 300.0,
fade_out_done, shsurf);
} else {
weston_view_destroy(shsurf->view);
if (shsurf->output_destroy_listener.notify) {
wl_list_remove(&shsurf->output_destroy_listener.link);
shsurf->output_destroy_listener.notify = NULL;
if (shsurf->shell->compositor->state == WESTON_COMPOSITOR_ACTIVE) {
pixman_region32_fini(&surface->pending.input);
pixman_region32_init(&surface->pending.input);
pixman_region32_fini(&surface->input);
pixman_region32_init(&surface->input);
weston_fade_run(shsurf->view, 1.0, 0.0, 300.0,
fade_out_done, shsurf);
return;
} else {
weston_surface_destroy(surface);
}
}
free(shsurf);
weston_view_destroy(shsurf->view);
if (shsurf->output_destroy_listener.notify) {
wl_list_remove(&shsurf->output_destroy_listener.link);
shsurf->output_destroy_listener.notify = NULL;
}
free(shsurf);
}
static void
......
......@@ -848,11 +848,11 @@ struct weston_seat {
};
enum {
WESTON_COMPOSITOR_ACTIVE, /* normal rendering and events */
WESTON_COMPOSITOR_IDLE, /* shell->unlock called on activity */
WESTON_COMPOSITOR_OFFSCREEN, /* no rendering, no frame events */
WESTON_COMPOSITOR_SLEEPING /* same as offscreen, but also set dpms
* to off */
WESTON_COMPOSITOR_ACTIVE, /* normal rendering and events */
WESTON_COMPOSITOR_IDLE, /* shell->unlock called on activity */
WESTON_COMPOSITOR_OFFSCREEN, /* no rendering, no frame events */
WESTON_COMPOSITOR_SLEEPING /* same as offscreen, but also set dpms
* to off */
};
struct weston_layer_entry {
......@@ -1012,22 +1012,22 @@ enum weston_capability {
* \endrststar
*/
struct weston_backend_config {
/** Major version for the backend-specific config struct
*
* This version must match exactly what the backend expects, otherwise
* the struct is incompatible.
*/
uint32_t struct_version;
/** Minor version of the backend-specific config struct
*
* This must be set to sizeof(struct backend-specific config).
* If the value here is smaller than what the backend expects, the
* extra config members will assume their default values.
*
* A value greater than what the backend expects is incompatible.
*/
size_t struct_size;
/** Major version for the backend-specific config struct
*
* This version must match exactly what the backend expects, otherwise
* the struct is incompatible.
*/
uint32_t struct_version;
/** Minor version of the backend-specific config struct
*
* This must be set to sizeof(struct backend-specific config).
* If the value here is smaller than what the backend expects, the
* extra config members will assume their default values.
*
* A value greater than what the backend expects is incompatible.
*/
size_t struct_size;
};
struct weston_backend;
......
......@@ -47,7 +47,7 @@ struct weston_windowed_output_api {
* Returns 0 on success, -1 on failure.
*
* This assigns a desired width and height to a windowed
* output. The backend decides what should be done and applies
* output. The backend decides what should be done and applies
* the desired configuration. After using this function and
* generic weston_output_set_*, a windowed
* output should be in a state where weston_output_enable()
......
......@@ -77,12 +77,21 @@ weston_desktop_create(struct weston_compositor *compositor,
return NULL;
}
#ifdef HAVE_DEPRECATED_WL_SHELL
weston_log("Warning: support for deprecated wl_shell interface is "
"enabled. Please migrate legacy clients to xdg-shell.\n");
desktop->wl_shell =
weston_desktop_wl_shell_create(desktop, display);
if (desktop->wl_shell == NULL) {
weston_desktop_destroy(desktop);
return NULL;
}
#else
weston_log("Note: support for the deprecated wl_shell interface is "
"disabled. If a legacy client still needs it, it can be "
"re-enabled by passing -Ddeprecated-wl-shell=true to Meson "
"when building Weston.\n");
#endif
weston_desktop_xwayland_init(desktop);
......
......@@ -37,6 +37,7 @@
#include <libweston-desktop/libweston-desktop.h>
#include "internal.h"
#include "shared/helpers.h"
/************************************************************************************
* WARNING: This file implements the stable xdg shell protocol.
......@@ -44,7 +45,7 @@
* implements the older unstable xdg shell v6 protocol.
************************************************************************************/
#define WD_XDG_SHELL_PROTOCOL_VERSION 1
#define WD_XDG_SHELL_PROTOCOL_VERSION 3
static const char *weston_desktop_xdg_toplevel_role = "xdg_toplevel";
static const char *weston_desktop_xdg_popup_role = "xdg_popup";
......@@ -129,10 +130,15 @@ struct weston_desktop_xdg_popup {
struct weston_desktop_xdg_surface *parent;
struct weston_desktop_seat *seat;
struct weston_geometry geometry;
bool pending_reposition;
uint32_t pending_reposition_token;
};
#define weston_desktop_surface_role_biggest_size (sizeof(struct weston_desktop_xdg_toplevel))
#define weston_desktop_surface_configure_biggest_size (sizeof(struct weston_desktop_xdg_toplevel))
#define weston_desktop_surface_role_biggest_size \
MAX(sizeof(struct weston_desktop_xdg_toplevel), \
sizeof(struct weston_desktop_xdg_popup))
#define weston_desktop_surface_configure_biggest_size weston_desktop_surface_role_biggest_size
static struct weston_geometry
......@@ -301,6 +307,27 @@ weston_desktop_xdg_positioner_protocol_set_offset(struct wl_client *wl_client,
positioner->offset.y = y;
}
static void
weston_desktop_xdg_positioner_protocol_set_reactive(struct wl_client *wl_client,
struct wl_resource *resource)
{
}
static void
weston_desktop_xdg_positioner_protocol_set_parent_size(struct wl_client *wl_client,
struct wl_resource *resource,
int32_t width,
int32_t height)
{
}
static void
weston_desktop_xdg_positioner_protocol_set_parent_configure(struct wl_client *wl_client,
struct wl_resource *resource,
uint32_t serial)
{
}
static void
weston_desktop_xdg_positioner_destroy(struct wl_resource *resource)
{
......@@ -318,6 +345,9 @@ static const struct xdg_positioner_interface weston_desktop_xdg_positioner_imple
.set_gravity = weston_desktop_xdg_positioner_protocol_set_gravity,
.set_constraint_adjustment = weston_desktop_xdg_positioner_protocol_set_constraint_adjustment,
.set_offset = weston_desktop_xdg_positioner_protocol_set_offset,
.set_reactive = weston_desktop_xdg_positioner_protocol_set_reactive,
.set_parent_size = weston_desktop_xdg_positioner_protocol_set_parent_size,
.set_parent_configure = weston_desktop_xdg_positioner_protocol_set_parent_configure,
};
static void
......@@ -701,7 +731,7 @@ weston_desktop_xdg_toplevel_committed(struct weston_desktop_xdg_toplevel *toplev
wl_resource_post_error(client_resource,
XDG_WM_BASE_ERROR_INVALID_SURFACE_STATE,
"xdg_surface buffer (%" PRIi32 " x %" PRIi32 ") "
"xdg_surface geometry (%" PRIi32 " x %" PRIi32 ") "
"is larger than the configured fullscreen state (%" PRIi32 " x %" PRIi32 ")",
geometry.width, geometry.height,
toplevel->next.size.width,
......@@ -852,9 +882,60 @@ weston_desktop_xdg_popup_protocol_grab(struct wl_client *wl_client,
popup->seat, serial);
}
static bool
is_positioner_valid(struct weston_desktop_xdg_positioner *positioner)
{
/* Checking whether the size and anchor rect both have a positive size
* is enough to verify both have been correctly set */
if (positioner->size.width == 0 || positioner->anchor_rect.width == 0)
return false;
if (positioner->anchor_rect.height == 0)
return false;
return true;
}
static void
weston_desktop_xdg_popup_protocol_reposition(struct wl_client *wl_client,
struct wl_resource *resource,
struct wl_resource *positioner_resource,
uint32_t token)
{
struct weston_desktop_surface *dsurface =
wl_resource_get_user_data(resource);
struct weston_desktop_xdg_popup *popup =
weston_desktop_surface_get_implementation_data(dsurface);
struct weston_desktop_xdg_positioner *positioner =
wl_resource_get_user_data(positioner_resource);
struct weston_desktop_surface *parent_dsurface;
if (!is_positioner_valid(positioner)) {
wl_resource_post_error(resource,
XDG_WM_BASE_ERROR_INVALID_POSITIONER,
"positioner object is not complete");
return;
}
parent_dsurface = popup->parent->desktop_surface;
popup->geometry =
weston_desktop_xdg_positioner_get_geometry(positioner,
dsurface,
parent_dsurface);
popup->pending_reposition = true;
popup->pending_reposition_token = token;
if (popup->committed)
weston_desktop_xdg_surface_schedule_configure(&popup->base);
}
static void
weston_desktop_xdg_popup_send_configure(struct weston_desktop_xdg_popup *popup)
{
if (popup->pending_reposition) {
popup->pending_reposition = false;
xdg_popup_send_repositioned(popup->resource,
popup->pending_reposition_token);
}
xdg_popup_send_configure(popup->resource,
popup->geometry.x,
popup->geometry.y,
......@@ -887,6 +968,16 @@ static void
weston_desktop_xdg_popup_update_position(struct weston_desktop_surface *dsurface,
void *user_data)
{
struct weston_desktop_xdg_popup *popup =
weston_desktop_surface_get_implementation_data(dsurface);
struct weston_desktop_surface *parent_dsurface;
parent_dsurface = popup->parent->desktop_surface;
weston_desktop_surface_set_relative_to(popup->base.desktop_surface,
parent_dsurface,
popup->geometry.x,
popup->geometry.y,
true);
}
static void
......@@ -932,6 +1023,7 @@ weston_desktop_xdg_popup_resource_destroy(struct wl_resource *resource)
static const struct xdg_popup_interface weston_desktop_xdg_popup_implementation = {
.destroy = weston_desktop_destroy_request,
.grab = weston_desktop_xdg_popup_protocol_grab,
.reposition = weston_desktop_xdg_popup_protocol_reposition,
};
static void
......@@ -1110,10 +1202,7 @@ weston_desktop_xdg_surface_protocol_get_popup(struct wl_client *wl_client,
parent_surface = wl_resource_get_user_data(parent_resource);
parent = weston_desktop_surface_get_implementation_data(parent_surface);
/* Checking whether the size and anchor rect both have a positive size
* is enough to verify both have been correctly set */
if (positioner->size.width == 0 || positioner->anchor_rect.width == 0 ||
positioner->anchor_rect.height == 0) {
if (!is_positioner_valid(positioner)) {
wl_resource_post_error(resource,
XDG_WM_BASE_ERROR_INVALID_POSITIONER,
"positioner object is not complete");
......@@ -1422,6 +1511,20 @@ weston_desktop_xdg_shell_protocol_get_xdg_surface(struct wl_client *wl_client,
wl_resource_get_user_data(surface_resource);
struct weston_desktop_xdg_surface *surface;
if (wsurface->committed) {
wl_resource_post_error(resource,
XDG_WM_BASE_ERROR_ROLE,
"xdg_surface must not have any other role");
return;
}
if (wsurface->buffer_ref.buffer != NULL) {
wl_resource_post_error(resource,
XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER,
"xdg_surface must not have a buffer at creation");
return;
}
surface = zalloc(weston_desktop_surface_role_biggest_size);
if (surface == NULL) {
wl_client_post_no_memory(wl_client);
......@@ -1449,13 +1552,6 @@ weston_desktop_xdg_shell_protocol_get_xdg_surface(struct wl_client *wl_client,
id, weston_desktop_xdg_surface_resource_destroy);
if (surface->resource == NULL)
return;
if (wsurface->buffer_ref.buffer != NULL) {
wl_resource_post_error(surface->resource,
XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER,
"xdg_surface must not have a buffer at creation");
return;
}
}
static void
......
......@@ -193,6 +193,17 @@ weston_desktop_xwayland_surface_destroy(struct weston_desktop_surface *dsurface,
free(surface);
}
static void
weston_desktop_xwayland_surface_close(struct weston_desktop_surface *dsurface,
void *user_data)
{
struct weston_desktop_xwayland_surface *surface = user_data;
struct weston_surface *wsurface =
weston_desktop_surface_get_surface(surface->surface);
surface->client_interface->send_close(wsurface);
}
static bool
weston_desktop_xwayland_surface_get_maximized(struct weston_desktop_surface *dsurface,
void *user_data)
......@@ -219,6 +230,7 @@ static const struct weston_desktop_surface_implementation weston_desktop_xwaylan
.get_fullscreen = weston_desktop_xwayland_surface_get_fullscreen,
.destroy = weston_desktop_xwayland_surface_destroy,
.close = weston_desktop_xwayland_surface_close,
};
static void
......
......@@ -458,15 +458,15 @@ move_frame(struct weston_view_animation *animation)
progress = 1.0 - progress;
scale = animation->start +
(animation->stop - animation->start) *
progress;
(animation->stop - animation->start) *
progress;
weston_matrix_init(&animation->transform.matrix);
if (move->scale)
weston_matrix_scale(&animation->transform.matrix, scale, scale,
1.0f);
weston_matrix_translate(&animation->transform.matrix,
move->dx * progress, move->dy * progress,
0);
move->dx * progress, move->dy * progress,
0);
}
static void
......
......@@ -62,8 +62,8 @@ drm_virtual_crtc_create(struct drm_backend *b, struct drm_output *output)
crtc->pipe = 0;
/* Poisoning the pointers as CRTC's of virtual outputs should not be
* added to the DRM-backend CRTC list. With this we can assure (in
* function drm_virtual_crtc_destroy()) that this did not happen. */
* added to the DRM-backend CRTC list. With this we can assure (in
* function drm_virtual_crtc_destroy()) that this did not happen. */
crtc->link.prev = POISON_PTR;
crtc->link.next = POISON_PTR;
......
......@@ -312,7 +312,12 @@ drm_output_update_complete(struct drm_output *output, uint32_t flags,
ts.tv_sec = sec;
ts.tv_nsec = usec * 1000;
weston_output_finish_frame(&output->base, &ts, flags);
if (output->state_cur->dpms != WESTON_DPMS_OFF)
weston_output_finish_frame(&output->base, &ts, flags);
else
weston_output_finish_frame(&output->base, NULL,
WP_PRESENTATION_FEEDBACK_INVALID);
/* We can't call this from frame_notify, because the output's
* repaint needed flag is cleared just after that */
......
......@@ -238,13 +238,13 @@ drm_fb_get_from_dmabuf(struct linux_dmabuf_buffer *dmabuf,
.modifier = dmabuf->attributes.modifier[0],
};
/* We should not import to KMS a buffer that has been allocated using no
* modifiers. Usually drivers use linear layouts to allocate with no
* modifiers, but this is not a rule. The driver could use, for
* instance, a tiling layout under the hood - and both Weston and the
* KMS driver can't know. So giving the buffer to KMS is not safe, as
* not knowing its layout can result in garbage being displayed. In
* short, importing a buffer to KMS requires explicit modifiers. */
/* We should not import to KMS a buffer that has been allocated using no
* modifiers. Usually drivers use linear layouts to allocate with no
* modifiers, but this is not a rule. The driver could use, for
* instance, a tiling layout under the hood - and both Weston and the
* KMS driver can't know. So giving the buffer to KMS is not safe, as
* not knowing its layout can result in garbage being displayed. In
* short, importing a buffer to KMS requires explicit modifiers. */
if (dmabuf->attributes.modifier[0] == DRM_FORMAT_MOD_INVALID)
return NULL;
......