D27788: Implement EGL_KHR_partial_update and EGL_EXT_swap_buffers_with_damage

Vlad Zahorodnii <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
zzag added inline comments.

INLINE COMMENTS

> egl_gbm_backend.cpp:441
>  
> +static QVector<EGLint> regionToRects(const QRegion &lastRegion, int height)
> +{

s/lastRegion/region/

> egl_gbm_backend.cpp:465
> +    {
> +        const QRegion region = (output.pendingDamagedRegions() | damagedRegion)
> +                                    & output.output->geometry();

`damagedRegion` contains the region that will be repainted in the next frame, so we don't need to accumulate surface damages again.

I suppose we want something like

  const QRegion region = damagedRegion & output.output->geometry();

> egl_gbm_backend.cpp:472
> +        if (!correct) {
> +            qCritical() << "failed eglSetDamageRegionKHR" << eglGetError();
> +        }

Use categorized logging please. Also, it's not a critical error if eglSetDamageRegionKHR() fails. qCWarning(KWIN_DRM) would be a better choice.

> egl_gbm_backend.cpp:529-541
> +QRegion EglGbmBackend::Output::pendingDamagedRegions() const
> +{
> +    QRegion region;
> +    // Note: An age of zero means the buffer contents are undefined
> +    if (bufferAge > 0 && bufferAge <= damageHistory.count()) {
> +        for (int i = 0; i < bufferAge - 1; i++)
> +            region |= damageHistory[i];

I think we can drop this method now since only EglGbmBackend::prepareRenderingForScreen() needs to accumulate damage.

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D27788

To: apol, #kwin, #plasma:_mobile, zzag
Cc: mwolff, zzag, davidedmundson, kwin, Orage, cacarry, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.