egl: Query available priorities at context creation time

Querying those once at screen setup time might yield the wrong results
if there are EGLContexts being created at a separate thread with differing
capabilities than the one calling eglInitialize().

There's two ways in which it may go wrong:
- The eglCreateContext thread has capabilities, but the thread where
  eglInitialize was called did not: The priority will be silently ignored,
  despite the ioctl still being able to succeed there.
- The eglInitialize thread had capabilities at the time of being called,
  but the eglCreateContext thread does not preserve them: The context will
  try to set the ioctl, but fail hard, and result on no context being created.
  This seems to go against EGL_IMG_context_priority extension.

It seems a better way that would provide the right results on mixed threads
with different capabilities is to query the allowed values at context
creation time. At this moment we can still reset the user-set priority on
failure (as future queries should return the assigned priority), and be sure
that the value is handled relative to the calling thread.

Also, drop a comment that no longer really applies after this change.
48 jobs for !2684 with context-priority-on-threads in 39 minutes and 19 seconds (queued for 4 seconds)
latest detached
Status Job ID Name Coverage
  Container
passed #916256
debian-10:amd64

00:20:51

passed #916258
aarch64
debian-10:arm64

00:00:56

passed #916259
aarch64
debian-10-test:arm64

00:00:35

passed #916257
debian-9:amd64

00:04:35

passed #916255
lava-container:arm64

00:02:07

passed #916254
lava-container:armhf

00:01:36

 
  Build
passed #916261
lava-build:arm64

00:04:23

passed #916260
lava-build:armhf

00:04:27

passed #916264
aarch64
meson-arm64

00:09:51

passed #916263
aarch64
meson-armhf

00:06:17

passed #916266
meson-clang

00:09:25

passed #916269
meson-clover

00:06:26

passed #916270
meson-clover-old-llvm

00:05:53

passed #916272
meson-i386

00:03:59

passed #916262
meson-main

00:12:35

passed #916273
meson-mingw32-x86_64

00:07:06

passed #916265
meson-swr-glvnd

00:07:37

passed #916271
meson-vulkan

00:07:01

passed #916274
scons

00:10:37

passed #916275
scons-old-llvm

00:07:06

passed #916267
scons-swr

00:07:43

passed #916268
scons-win64

00:10:36

 
  Test
passed #916298
db410c
arm64_a306_gles2 1/4

00:04:09

passed #916299
db410c
arm64_a306_gles2 2/4

00:04:57

passed #916300
db410c
arm64_a306_gles2 3/4

00:03:57

passed #916301
db410c
arm64_a306_gles2 4/4

00:04:01

passed #916287
mesa-cheza
arm64_a630_gles2

00:04:41

passed #916288
mesa-cheza
arm64_a630_gles31 1/4

00:04:46

passed #916289
mesa-cheza
arm64_a630_gles31 2/4

00:05:39

passed #916290
mesa-cheza
arm64_a630_gles31 3/4

00:05:06

passed #916291
mesa-cheza
arm64_a630_gles31 4/4

00:05:16

passed #916292
mesa-cheza
arm64_a630_gles3 1/6

00:03:55

passed #916293
mesa-cheza
arm64_a630_gles3 2/6

00:03:46

passed #916294
mesa-cheza
arm64_a630_gles3 3/6

00:03:39

passed #916295
mesa-cheza
arm64_a630_gles3 4/6

00:03:56

passed #916296
mesa-cheza
arm64_a630_gles3 5/6

00:03:56

passed #916297
mesa-cheza
arm64_a630_gles3 6/6

00:03:57

passed #916276
lava-rk3288-veyron-jaq
panfrost-t760-test:armhf

00:06:09

passed #916277
lava-rk3399-gru-kevin
panfrost-t860-test:arm64

00:05:15

passed #916278
test-llvmpipe-gles2 1/4

00:03:30

passed #916279
test-llvmpipe-gles2 2/4

00:03:49

passed #916280
test-llvmpipe-gles2 3/4

00:03:39

passed #916281
test-llvmpipe-gles2 4/4

00:02:29

passed #916282
test-softpipe-gles2 1/4

00:01:35

passed #916283
test-softpipe-gles2 2/4

00:01:47

passed #916284
test-softpipe-gles2 3/4

00:01:09

passed #916285
test-softpipe-gles2 4/4

00:01:35

passed #916286
test-softpipe-gles3-limited

00:05:50