Lines Matching defs:dev
130 panfrost_query_l2_slices(const struct panfrost_device *dev)
134 panfrost_query_raw(dev->fd, DRM_PANFROST_PARAM_MEM_FEATURES,
237 panfrost_supports_compressed_format(struct panfrost_device *dev, unsigned fmt)
245 return dev->compressed_formats & (1 << idx);
269 panfrost_query_optimal_tib_size(const struct panfrost_device *dev)
274 assert(dev->model->tilebuffer_size >= 2048);
275 assert(util_is_power_of_two_nonzero(dev->model->tilebuffer_size));
277 return dev->model->tilebuffer_size / 2;
281 panfrost_open_device(void *memctx, int fd, struct panfrost_device *dev)
283 dev->fd = fd;
284 dev->memctx = memctx;
285 dev->gpu_id = panfrost_query_gpu_version(fd);
286 dev->arch = pan_arch(dev->gpu_id);
287 dev->kernel_version = drmGetVersion(fd);
288 dev->revision = panfrost_query_gpu_revision(fd);
289 dev->model = panfrost_get_model(dev->gpu_id);
292 if (!dev->model)
295 dev->core_count = panfrost_query_core_count(fd, &dev->core_id_range);
296 dev->thread_tls_alloc = panfrost_query_thread_tls_alloc(fd, dev->arch);
297 dev->optimal_tib_size = panfrost_query_optimal_tib_size(dev);
298 dev->compressed_formats = panfrost_query_compressed_formats(fd);
299 dev->tiler_features = panfrost_query_tiler_features(fd);
300 dev->has_afbc = panfrost_query_afbc(fd, dev->arch);
302 if (dev->arch <= 6)
303 dev->formats = panfrost_pipe_format_v6;
304 else if (dev->arch <= 7)
305 dev->formats = panfrost_pipe_format_v7;
307 dev->formats = panfrost_pipe_format_v9;
309 util_sparse_array_init(&dev->bo_map, sizeof(struct panfrost_bo), 512);
311 pthread_mutex_init(&dev->bo_cache.lock, NULL);
312 list_inithead(&dev->bo_cache.lru);
314 for (unsigned i = 0; i < ARRAY_SIZE(dev->bo_cache.buckets); ++i)
315 list_inithead(&dev->bo_cache.buckets[i]);
318 if (dev->debug & (PAN_DBG_TRACE | PAN_DBG_SYNC))
319 pandecode_initialize(!(dev->debug & PAN_DBG_TRACE));
325 dev->tiler_heap = panfrost_bo_create(dev, 128 * 1024 * 1024,
328 pthread_mutex_init(&dev->submit_lock, NULL);
331 panfrost_upload_sample_positions(dev);
335 panfrost_close_device(struct panfrost_device *dev)
340 if (dev->model) {
341 pthread_mutex_destroy(&dev->submit_lock);
342 panfrost_bo_unreference(dev->tiler_heap);
343 panfrost_bo_cache_evict_all(dev);
344 pthread_mutex_destroy(&dev->bo_cache.lock);
345 util_sparse_array_finish(&dev->bo_map);
348 drmFreeVersion(dev->kernel_version);
349 close(dev->fd);