From 664676a2b40bf1a84f06c97a5e2b86e2cb774134 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Mon, 28 Mar 2022 11:01:33 +0200 Subject: [PATCH] intel/gpu: support 64bit pci bars by using the io_mem RPC of the platform session instead of parsing the bar resources manually. This commits avoids and breakage on systems where the Intel graphic cards just uses 64bits with addresses above 4G. Issue #4450 --- repos/os/src/drivers/gpu/intel/resources.h | 27 +++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/repos/os/src/drivers/gpu/intel/resources.h b/repos/os/src/drivers/gpu/intel/resources.h index e8ccf6ef1d..7391a8f308 100644 --- a/repos/os/src/drivers/gpu/intel/resources.h +++ b/repos/os/src/drivers/gpu/intel/resources.h @@ -64,7 +64,7 @@ class Igd::Resources : Genode::Noncopyable /* mmio + ggtt */ Platform::Device::Resource _gttmmadr { }; Io_mem_dataspace_capability _gttmmadr_ds { }; - Genode::Constructible _gttmmadr_io { }; + Genode::Io_mem_session_capability _gttmmadr_io { }; addr_t _gttmmadr_local { 0 }; Genode::Constructible _mmio { }; @@ -89,7 +89,7 @@ class Igd::Resources : Genode::Noncopyable Platform::Device::Resource _gmadr { }; Io_mem_dataspace_capability _gmadr_ds { }; - Genode::Constructible _gmadr_io { }; + Genode::Io_mem_session_capability _gmadr_io { }; Genode::Region_map_client _gmadr_rm { _rm_connection.create(APERTURE_RESERVED) }; @@ -241,14 +241,25 @@ class Igd::Resources : Genode::Noncopyable _gpu_client.construct(_gpu_cap); - _gttmmadr = _gpu_client->resource(0); - _gttmmadr_io.construct(_env, _gttmmadr.base(), _gttmmadr.size()); - _gttmmadr_ds = _gttmmadr_io->dataspace(); + /* + * The intel display driver (as client of this gpu driver) + * uses the platform.io_mem() cap interface to obtain the io_mem + * capabilities. The need for directly handling with the physical + * io_mem addresses is not desired and the legacy path. So dummy + * addresses are used here just as placeholder for implementing + * the platform.resource() RPC interface. + */ - _gmadr = _gpu_client->resource(2); - _gmadr_io.construct(_env, _gmadr.base(), _gmadr.size(), true); - _gmadr_ds = _gmadr_io->dataspace(); + _gttmmadr_io = _gpu_client->io_mem(0); + _gttmmadr_ds = Genode::Io_mem_session_client(_gttmmadr_io).dataspace(); + _gttmmadr = Platform::Device::Resource(1u << 30 /* dummy */, + Genode::Dataspace_client(_gttmmadr_ds).size()); + + _gmadr_io = _gpu_client->io_mem(1, Genode::Cache::WRITE_COMBINED); + _gmadr_ds = Genode::Io_mem_session_client(_gmadr_io).dataspace(); _gmadr_rm.attach_at(_gmadr_ds, 0, APERTURE_RESERVED); + _gmadr = Platform::Device::Resource(1u << 29 /* dummy */, + Genode::Dataspace_client(_gmadr_ds).size()); _enable_pci_bus_master();