Skip to content
Snippets Groups Projects
Select Git revision
  • 7c78fdbace0ff9bd2a2f1206182c054462b006af
  • drm-misc-templates default
  • wip/final/kci-gitlab-lava-v1
  • wip/vignesh/kci-lava-gitlab-runner
  • kci-gitlab-igt-v8
  • kci-gitlab-igt-v4
  • drm-misc-fixes-2024-10-02
  • drm-misc-next-2024-09-26
  • drm-misc-fixes-2024-09-26
  • drm-misc-next-2024-09-20
  • drm-misc-fixes-2024-09-12
  • drm-misc-fixes-2024-09-05
  • drm-misc-next-fixes-2024-09-05
  • drm-misc-fixes-2024-08-29
  • drm-misc-next-2024-08-29
  • drm-misc-next-2024-08-22
  • drm-misc-fixes-2024-08-22
  • drm-misc-next-2024-08-16
  • drm-misc-fixes-2024-08-15
  • drm-misc-next-2024-08-09
  • drm-misc-fixes-2024-08-08
  • drm-misc-next-2024-08-01
  • drm-misc-fixes-2024-08-01
  • drm-misc-next-fixes-2024-07-25
  • drm-misc-next-fixes-2024-07-19
  • drm-misc-next-fixes-2024-07-11
26 results

v3d_drv.h

Blame
  • v3d_drv.h 15.40 KiB
    // SPDX-License-Identifier: GPL-2.0+
    /* Copyright (C) 2015-2018 Broadcom */
    
    #include <linux/delay.h>
    #include <linux/mutex.h>
    #include <linux/spinlock_types.h>
    #include <linux/workqueue.h>
    
    #include <drm/drm_encoder.h>
    #include <drm/drm_gem.h>
    #include <drm/drm_gem_shmem_helper.h>
    #include <drm/gpu_scheduler.h>
    
    #include "v3d_performance_counters.h"
    
    #include "uapi/drm/v3d_drm.h"
    
    struct clk;
    struct platform_device;
    struct reset_control;
    
    #define GMP_GRANULARITY (128 * 1024)
    
    #define V3D_MMU_PAGE_SHIFT 12
    
    #define V3D_MAX_QUEUES (V3D_CPU + 1)
    
    static inline char *v3d_queue_to_string(enum v3d_queue queue)
    {
    	switch (queue) {
    	case V3D_BIN: return "bin";
    	case V3D_RENDER: return "render";
    	case V3D_TFU: return "tfu";
    	case V3D_CSD: return "csd";
    	case V3D_CACHE_CLEAN: return "cache_clean";
    	case V3D_CPU: return "cpu";
    	}
    	return "UNKNOWN";
    }
    
    struct v3d_stats {
    	u64 start_ns;
    	u64 enabled_ns;
    	u64 jobs_completed;
    
    	/*
    	 * This seqcount is used to protect the access to the GPU stats
    	 * variables. It must be used as, while we are reading the stats,
    	 * IRQs can happen and the stats can be updated.
    	 */
    	seqcount_t lock;
    };
    
    struct v3d_queue_state {
    	struct drm_gpu_scheduler sched;
    
    	u64 fence_context;
    	u64 emit_seqno;
    
    	/* Stores the GPU stats for this queue in the global context. */
    	struct v3d_stats stats;
    };
    
    /* Performance monitor object. The perform lifetime is controlled by userspace
     * using perfmon related ioctls. A perfmon can be attached to a submit_cl
     * request, and when this is the case, HW perf counters will be activated just
     * before the submit_cl is submitted to the GPU and disabled when the job is
     * done. This way, only events related to a specific job will be counted.
     */
    struct v3d_perfmon {