[PATCH 2/2] exa: Verify non-null pSrc in mgaDownloadFromScreen()

Alex Deucher alexdeucher at gmail.com
Tue Mar 3 12:21:23 PST 2015


On Tue, Mar 3, 2015 at 2:21 PM, Tormod Volden <lists.tormod at gmail.com> wrote:
> On Tue, Mar 3, 2015 at 3:18 AM, Michel Dänzer wrote:
>> On 03.03.2015 05:01, Tormod Volden wrote:
>>>  mgaDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h,
>>>                        char *dst, int dst_pitch)
>>>  {
>>> +    if (!pSrc)
>>> +     return FALSE;
>>> +
>>>      PMGA(pSrc);
>>>
>>>      char *src = pMga->ExaDriver->memoryBase + exaGetPixmapOffset(pSrc);
>>>
>>
>> This isn't necessary. Only pScrPict->pDrawable and pMaskPict->pDrawable
>> can be NULL in mgaCheckComposite. EXA never calls driver hooks with NULL
>> PixmapPtrs.
>
> Hi Michel,
>
> Thanks for the response. OK, good to know. I was wondering about that,
> so I left it in a separate patch.
>
>>
>>
>> About patch 1, since mgaDownloadFromScreen doesn't do anything fancier
>> than memcpy, you can just remove it altogether and leave
>> pExa->DownloadFromScreen NULL. EXA then does basically the same thing
>> mgaDownloadFromScreen does.
>
> Yes, Connor also suggested that. However, I would like in any case to
> correct the old code first. Does the "general" EXA also do the
> equivalent to QUIESCE_DMA()?
>

It calls waitMarker before doing sw ops if that is what you are asking.

Alex


More information about the xorg-devel mailing list