[PATCH v2 2/6] modesetting: Use a gbm buffer for shadow if we are using glamor
Jason Ekstrand
jason at jlekstrand.net
Thu Jan 8 20:49:04 PST 2015
On Thu, Jan 8, 2015 at 8:30 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
>
>
> On Thu, Jan 8, 2015 at 2:10 PM, Keith Packard <keithp at keithp.com> wrote:
>
>> Jason Ekstrand <jason at jlekstrand.net> writes:
>>
>> > + old_shadow = drmmode->shadow_bo;
>> >
>> > if (!drmmode_create_bo(drmmode, &drmmode->front_bo,
>> > width, height, scrn->bitsPerPixel))
>> > @@ -1218,13 +1219,9 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int
>> width, int height)
>> > }
>> >
>> > if (drmmode->shadow_enable) {
>> > - uint32_t size = scrn->displayWidth * scrn->virtualY *
>> > - ((scrn->bitsPerPixel + 7) >> 3);
>> > - new_pixels = calloc(1, size);
>> > - if (new_pixels == NULL)
>> > + if (!drmmode_create_bo(drmmode, &drmmode->shadow_bo,
>> > + width, height, scrn->bitsPerPixel))
>> > goto fail;
>> > - free(drmmode->shadow_fb);
>> > - drmmode->shadow_fb = new_pixels;
>> > }
>>
>> I don't see the old shadow_bo getting freed anywhere; did I miss
>> something?
>>
>
> The real answer is that, as far as I can tell, this code shouldn't be
> touching the shadow and the shadow shouldn't be in the drmmode structure at
> all. Unless I'm competely missing everything, shadows should be per-crtc.
> If that's correct, then the modesetting driver's shadow handling is just
> completely bogus. I'm reworking things again.
>
Correction, we have two completely different concepts of "shadow fb" going
on here. One is the shadow from miext/shadow that seems to cover the
entire screen pixmap. The other shadow buffers, the ones used for
rotation, should be per-crtc. These two concepts of shadow buffers are, as
far as I can tell, completely seperate.
Given that I can't seem to figure out what miext/shadow does, I'm kind of
at a loss. My best guess is that it effectively causes X to be
double-buffered by rendering in the primary pixmap and blitting to the
shadow for actual scan-out. That said, I'm not really sure. How should
this interact with per-crtc rotation shadow buffers? I have no idea.
Also, the xf86-video-intel driver doesn't use it at all, so my go-to
example isn't helping. A little help here?
--Jason
>
> This patch series just keeps getting longer...
>
>
>>
>> The rest of this patch looks good and is
>>
>> Reviewed-by: Keith Packard <keithp at keithp.com>
>>
>> --
>> -keith
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150108/ad32c814/attachment.html>
More information about the xorg-devel
mailing list