[PATCH xserver] cursor: add hw cursor support for prime

Michel Dänzer michel at daenzer.net
Tue Sep 6 01:30:45 UTC 2016


On 05/09/16 10:42 PM, Hans de Goede wrote:
> Hi,
> 
> Subject should have contained v4, resending so that we've
> the right version in patchwork. Sorry.

Hmm, for some reason I'm not receiving your recent patches from the
mailing list, though I can see them in the list archives and in patchwork.


Does v4 work correctly with e.g. rotated slave outputs? AFAIR an earlier
revision didn't when I tested it.


>> Changes in v2:
>> -hotplugging causes the driver to try and register
>>  the cursor private, however we can't register
>>  these at runtime yet, we need to add support for
>>  reallocation of cursor screen privates. However
>>  all hotplugged devices currently don't support
>>  HW cursors, so punt for now. This means GPUs
>>  already in the system will get hw cursors
>>  and USB ones won't which is all we care about
>>  presently.

Note that this isn't strictly true, see e.g.
https://bugs.freedesktop.org/show_bug.cgi?id=97313 for a (failed)
attempt to hotplug a GPU screen which could support HW cursors.


>> diff --git a/dix/privates.c b/dix/privates.c
>> index 969d014..478f52c 100644
>> --- a/dix/privates.c
>> +++ b/dix/privates.c
>> @@ -783,3 +783,12 @@ dixResetPrivates(void)
>>          global_keys[t].allocated = 0;
>>      }
>>  }
>> +
>> +Bool
>> +dixPrivatesCreated(DevPrivateType type)
>> +{
>> +    if (global_keys[type].created)
>> +        return TRUE;
>> +    else
>> +        return FALSE;
>> +}

This should probably be a separate patch.


>> diff --git a/hw/xfree86/ramdac/xf86Cursor.c
>> b/hw/xfree86/ramdac/xf86Cursor.c
>> index dda4349..afcce53 100644
>> --- a/hw/xfree86/ramdac/xf86Cursor.c
>> +++ b/hw/xfree86/ramdac/xf86Cursor.c
>> @@ -337,16 +337,9 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr
>> pScreen, CursorPtr pCurs,
>>              return;
>>          }
>>
>> -        if (infoPtr->pScrn->vtSema &&
>> xorg_list_is_empty(&pScreen->pixmap_dirty_list) &&
>> +        if (infoPtr->pScrn->vtSema &&
>>              (ScreenPriv->ForceHWCursorCount ||
>> -             ((
>> -               cursor->bits->argb &&
>> -               infoPtr->UseHWCursorARGB &&
>> -               (*infoPtr->UseHWCursorARGB)(pScreen, cursor)) ||
>> -              (cursor->bits->argb == 0 &&
>> -               (cursor->bits->height <= infoPtr->MaxHeight) &&
>> -               (cursor->bits->width <= infoPtr->MaxWidth) &&
>> -               (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor)
>> (pScreen, cursor)))))) {
>> +             xf86CheckHWCursor(pScreen, cursor, infoPtr))) {
>>
>>              if (ScreenPriv->SWCursor)   /* remove the SW cursor */
>>                  (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen,

At least the initial refactoring of xf86CheckHWCursor should also be a
separate patch, for easier review of this patch and better bisectability.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-devel mailing list