[PATCH] nouveau: bring back legacy mmap handler
Dave Airlie
airlied at gmail.com
Tue Dec 16 15:25:21 PST 2014
On 16 December 2014 at 18:56, Daniel Vetter <daniel at ffwll.ch> wrote:
> On Tue, Dec 16, 2014 at 04:34:39PM +1000, Dave Airlie wrote:
>> From: Dave Airlie <airlied at redhat.com>
>>
>> nouveau userspace back at 1.0.1 used to call the X server
>> DRIOpenDRMMaster interface even for DRI2 (doh!), this attempts
>> to map the sarea and fails if it can't.
>>
>> Since 884c6dabb0eafe7227f099c9e78e514191efaf13 from Daniel,
>> this fails, but only ancient drivers would see it.
>>
>> Revert the nouveau bits of that fix, and hope it works.
>>
>> Signed-off-by: Dave Airlie <airlied at redhat.com>
>
> Argh, sorry for missing that in my git history digging.
>
> Acked-by: Daniel Vetter <daniel.vetter at ffwll.ch>
>
> Now curious question: Would return 0 also work? As long as userspace only
> cares about the errno of the ioctl call and doesn't actually look at the
> sarea itself we could keep the cake and eat it, too. I've used a similar
> trick in legacy context code, again because old nouveau had copypasta from
> dri1, but only cared about the errno and not whether the contexts actually
> did anything useful.
if (drmMap(tmp.drmFD, tmp.hLSAREA, sAreaSize,
(drmAddressPtr) (&tmp.pLSAREA)) < 0) {
DRIDrvMsg(-1, X_INFO, "[drm] Mapping SAREA for DRM lock failed.\n");
tmp.pLSAREA = NULL;
goto out_err;
}
memset(tmp.pLSAREA, 0, sAreaSize);
seems unlikely return 0 will work!
Dave.
More information about the dri-devel
mailing list