iris: check i915 features after hw gen

when running recent Mesa on i855 (gen 2) without amber drivers:
  error: Kernel is too old for Iris. Consider upgrading to kernel v4.16.

  libGL error: glx: failed to create dri3 screen
  libGL error: failed to load driver: iris
  error: Kernel is too old for Iris. Consider upgrading to kernel v4.16.

  libGL error: glx: failed to create dri2 screen
  libGL error: failed to load driver: iris

move the i915 feature check to after the hardware generation check
which results in:
  MESA: warning: Driver does not support the 0x3582 PCI ID.
  libGL error: glx: failed to create dri3 screen
  libGL error: failed to load driver: iris
  MESA: warning: Driver does not support the 0x3582 PCI ID.
  libGL error: glx: failed to create dri2 screen
  libGL error: failed to load driver: iris

Cc: mesa-stable
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18563>
This commit is contained in:
Jonathan Gray
2022-09-13 15:57:28 +10:00
committed by Marge Bot
parent 4e2d88781d
commit ed5d16cec1

View File

@@ -775,6 +775,19 @@ iris_init_identifier_bo(struct iris_screen *screen)
struct pipe_screen *
iris_screen_create(int fd, const struct pipe_screen_config *config)
{
struct iris_screen *screen = rzalloc(NULL, struct iris_screen);
if (!screen)
return NULL;
if (!intel_get_device_info_from_fd(fd, &screen->devinfo))
return NULL;
screen->pci_id = screen->devinfo.pci_device_id;
p_atomic_set(&screen->refcount, 1);
if (screen->devinfo.ver < 8 || screen->devinfo.platform == INTEL_PLATFORM_CHV)
return NULL;
/* Here are the i915 features we need for Iris (in chronological order) :
* - I915_PARAM_HAS_EXEC_NO_RELOC (3.10)
* - I915_PARAM_HAS_EXEC_HANDLE_LUT (3.10)
@@ -789,19 +802,6 @@ iris_screen_create(int fd, const struct pipe_screen_config *config)
return NULL;
}
struct iris_screen *screen = rzalloc(NULL, struct iris_screen);
if (!screen)
return NULL;
if (!intel_get_device_info_from_fd(fd, &screen->devinfo))
return NULL;
screen->pci_id = screen->devinfo.pci_device_id;
p_atomic_set(&screen->refcount, 1);
if (screen->devinfo.ver < 8 || screen->devinfo.platform == INTEL_PLATFORM_CHV)
return NULL;
driParseConfigFiles(config->options, config->options_info, 0, "iris",
NULL, NULL, NULL, 0, NULL, 0);