[PATCH weston v11 11/13] compositor-drm: Don't repaint if no damage

Daniel Stone daniel at fooishbar.org
Mon Aug 28 19:58:25 UTC 2017


Hi,

On 21 July 2017 at 15:18, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> On Tue, 18 Jul 2017 14:14:33 +0100
> Daniel Stone <daniels at collabora.com> wrote:
>> @@ -1517,10 +1518,20 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage)
>>       if (scanout_state->fb)
>>               return;
>>
>> -     if (b->use_pixman)
>> +     if (!pixman_region32_not_empty(damage) &&
>> +         scanout_plane->state_cur->fb &&
>> +         (scanout_plane->state_cur->fb->type == BUFFER_GBM_SURFACE ||
>> +          scanout_plane->state_cur->fb->type == BUFFER_PIXMAN_DUMB) &&
>> +         scanout_plane->state_cur->fb->width ==
>> +             output->base.current_mode->width &&
>> +         scanout_plane->state_cur->fb->height ==
>> +             output->base.current_mode->height) {
>> +             fb = drm_fb_ref(scanout_plane->state_cur->fb);
>> +     } else if (b->use_pixman) {
>>               fb = drm_output_render_pixman(state, damage);
>> -     else
>> +     } else {
>>               fb = drm_output_render_gl(state, damage);
>> +     }
>>
>>       if (!fb) {
>>               drm_plane_state_put_back(scanout_state);
>
> is there a reason to check the buffer type at all? You want to be sure
> the previous buffer came from the renderer? But if there is no damage
> and state_cur has a BUFFER_CLIENT, is there any harm in re-using that?
> OTOH, if there is no damage, one would assume the BUFFER_CLIENT would
> have been kept promoted to scanout...
>
> Shrug? :-)

I was mainly thinking of the case where we transition from planes
enabled - with a client buffer promoted - to planes disabled. In that
case, we need to repaint, but wasn't sure if we'd have damage or not
by that point, since assign_planes is never run.

Cheers,
Daniel


More information about the wayland-devel mailing list