mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 22:08:26 +02:00
freedreno/drm: don't crash for unsupported devices
For unsupported devices fd_pipe_new() will return NULL, causing a crash when fd_device_new() tries to check device generation. Handle fd_pipe_new() returning NULL by destroying device and returning NULL. Fixes:4861067689("freedreno/drm: Add sub-allocator") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26961> (cherry picked from commit7a81855a67)
This commit is contained in:
parent
25aa495324
commit
ceb2551194
2 changed files with 8 additions and 1 deletions
|
|
@ -1494,7 +1494,7 @@
|
|||
"description": "freedreno/drm: don't crash for unsupported devices",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "48610676897d989ff8ce604022e7d611cec9c131",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -104,6 +104,9 @@ out:
|
|||
if (!use_heap) {
|
||||
struct fd_pipe *pipe = fd_pipe_new(dev, FD_PIPE_3D);
|
||||
|
||||
if (!pipe)
|
||||
goto fail;
|
||||
|
||||
/* Userspace fences don't appear to be reliable enough (missing some
|
||||
* cache flushes?) on older gens, so limit sub-alloc heaps to a6xx+
|
||||
* for now:
|
||||
|
|
@ -119,6 +122,10 @@ out:
|
|||
}
|
||||
|
||||
return dev;
|
||||
|
||||
fail:
|
||||
fd_device_del(dev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* like fd_device_new() but creates it's own private dup() of the fd
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue