[PATCH xserver] modesetting: resubmit dirty rects on EINVAL

Michael Thayer michael.thayer at oracle.com
Sat Jul 16 13:46:27 UTC 2016


On 16.07.2016 11:28, walter harms wrote:
>
> Am 15.07.2016 17:28, schrieb Adam Jackson:
>> This error code can mean we're submitting more rects at once than the
>> driver can handle. If that happens, resubmit one at a time.
>>
>> Signed-off-by: Adam Jackson <ajax at redhat.com>
>> ---
>>   hw/xfree86/drivers/modesetting/driver.c | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
>> index 262a899..2de16f6 100644
>> --- a/hw/xfree86/drivers/modesetting/driver.c
>> +++ b/hw/xfree86/drivers/modesetting/driver.c
>> @@ -515,6 +515,17 @@ dispatch_dirty_region(ScrnInfoPtr scrn,
>>
>>           /* TODO query connector property to see if this is needed */
>>           ret = drmModeDirtyFB(ms->fd, fb_id, clip, num_cliprects);
>> +
>> +        /* if we're swamping it with work, try one at a time */
>> +        if (ret == -EINVAL) {
>> +            for (i = 0; i < num_cliprects; i++) {
>> +                if (drmModeDirtyFB(ms->fd, fb_id, &clip[i], 1) == -EINVAL)
>> +                    break;
>> +            }
>> +            if (i == num_cliprects)
>> +                ret = 0;
>> +        }
>> +
>
> maybe these more simple version works also ?
>
>   	 if (ret == -EINVAL) {
>              for (i = 0; i < num_cliprects; i++) {
> 	        ret=drmModeDirtyFB(ms->fd, fb_id, &clip[i], 1);
>                  if ( ret == -EINVAL)
>                      break;
>             }
>          }
>
> the whole thing works only if drmModeDirtyFB() never returns something else
> than  -EINVAL. Perhaps it is more robust just to check for <0  ?
> (note: i am not an expert on this, just curious)

That does make some sense, but since I have not yet reproduced the 
problem this patch fixes getting it tested is a bit of a long cycle. 
Would you consider it reasonably to review and commit it without that 
test?  Or any thoughts about how one could easily trigger dirtying more 
than 256 rectangles at once?

Regards,

Michael

>
>
> re,
>   wh
>
>>           free(clip);
>>           DamageEmpty(damage);
>>       }
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
>

-- 
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister 
der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher


More information about the xorg-devel mailing list