etnaviv: Make sure to track different pipe_screens for different DRM device descriptions
pipe_screens that are created used to be dedublicated directly based on the gpu device file.
If a process created two of them, for example by opening the etnaviv render node twice
and calling gbm_create_device
, or by opening two card nodes which used kmsro, or any
combination of these things, then for any but the first instance, the gem handles created
for it would be for the first one instead of the intended one, due to them being created
using the same pipe_screen, and buffers allocated for kmsro devices would be allocated using
the wrong file description as well. This can lead to various problems, such as a proccess not
being able to use two cards which use kmsro at the same time, for example.
This patch tries to create different pipe_screens for tracking the proper struct renderonly
with the correct device descriptions, such that gem handles for the correct file descriptions
can be created and returned. However, it also tries to keep every that was dedublicated before
dedublicated. This is done by introducing a new struct etna_pipe_screen
just to keep track of
the corresponding struct renderonly
, but keeping all handles and stuff on the existing shared
struct etna_screen
(to which struct etna_pipe_screen
has a reference), while exporting handles
as needed.
This way, all resources can stay consolidated, while the handles returned by gem are for the correct device.
Signed-off-by: Daniel Abrecht public@danielabrecht.ch