Lines Matching refs:dev
183 panfrost_supports_compressed_format(struct panfrost_device *dev, unsigned fmt)
191 return dev->compressed_formats & (1 << idx);
231 panfrost_open_device(void *memctx, int fd, struct panfrost_device *dev)
233 dev->fd = fd;
234 dev->memctx = memctx;
235 dev->gpu_id = panfrost_query_gpu_version(fd);
236 dev->arch = pan_arch(dev->gpu_id);
237 dev->core_count = panfrost_query_core_count(fd);
238 dev->thread_tls_alloc = panfrost_query_thread_tls_alloc(fd, dev->arch);
239 dev->kernel_version = drmGetVersion(fd);
241 dev->quirks = panfrost_get_quirks(dev->gpu_id, revision);
242 dev->compressed_formats = panfrost_query_compressed_formats(fd);
243 dev->tiler_features = panfrost_query_tiler_features(fd);
244 dev->has_afbc = panfrost_query_afbc(fd, dev->arch);
246 if (dev->quirks & HAS_SWIZZLES)
247 dev->formats = panfrost_pipe_format_v6;
249 dev->formats = panfrost_pipe_format_v7;
251 util_sparse_array_init(&dev->bo_map, sizeof(struct panfrost_bo), 512);
253 pthread_mutex_init(&dev->bo_cache.lock, NULL);
254 list_inithead(&dev->bo_cache.lru);
256 for (unsigned i = 0; i < ARRAY_SIZE(dev->bo_cache.buckets); ++i)
257 list_inithead(&dev->bo_cache.buckets[i]);
260 if (dev->debug & (PAN_DBG_TRACE | PAN_DBG_SYNC))
261 pandecode_initialize(!(dev->debug & PAN_DBG_TRACE));
267 dev->tiler_heap = panfrost_bo_create(dev, 64 * 1024 * 1024,
270 pthread_mutex_init(&dev->submit_lock, NULL);
273 panfrost_upload_sample_positions(dev);
277 panfrost_close_device(struct panfrost_device *dev)
279 pthread_mutex_destroy(&dev->submit_lock);
280 panfrost_bo_unreference(dev->tiler_heap);
281 panfrost_bo_cache_evict_all(dev);
282 pthread_mutex_destroy(&dev->bo_cache.lock);
283 drmFreeVersion(dev->kernel_version);
284 util_sparse_array_finish(&dev->bo_map);
285 close(dev->fd);