UAPI Changes: - Weak parallel submission support for execlists Minimal implementation of the parallel submission support for execlists backend that was previously only implemented for GuC. Support one sibling non-virtual engine. Core Changes: - Two backmerges of drm/drm-next for header file renames/changes and i915_regs reorganization Driver Changes: - Add new DG2 subplatform: DG2-G12 (Matt R) - Add new DG2 workarounds (Matt R, Ram, Bruce) - Handle pre-programmed WOPCM registers for DG2+ (Daniele) - Update guc shim control programming on XeHP SDV+ (Daniele) - Add RPL-S C0/D0 stepping information (Anusha) - Improve GuC ADS initialization to work on ARM64 on dGFX (Lucas) - Fix KMD and GuC race on accessing PMU busyness (Umesh) - Use PM timestamp instead of RING TIMESTAMP for reference in PMU with GuC (Umesh) - Report error on invalid reset notification from GuC (John) - Avoid WARN splat by holding RPM wakelock during PXP unbind (Juston) - Fixes to parallel submission implementation (Matt B.) - Improve GuC loading status check/error reports (John) - Tweak TTM LRU priority hint selection (Matt A.) - Align the plane_vma to min_page_size of stolen mem (Ram) - Introduce vma resources and implement async unbinding (Thomas) - Use struct vma_resource instead of struct vma_snapshot (Thomas) - Return some TTM accel move errors instead of trying memcpy move (Thomas) - Fix a race between vma / object destruction and unbinding (Thomas) - Remove short-term pins from execbuf (Maarten) - Update to GuC version 69.0.3 (John, Michal Wa.) - Improvements to GT reset paths in GuC backend (Matt B.) - Use shrinker_release_pages instead of writeback in shmem object hooks (Matt A., Tvrtko) - Use trylock instead of blocking lock when freeing GEM objects (Maarten) - Allocate intel_engine_coredump_alloc with ALLOW_FAIL (Matt B.) - Fixes to object unmapping and purging (Matt A) - Check for wedged device in GuC backend (John) - Avoid lockdep splat by locking dpt_obj around set_cache_level (Maarten) - Allow dead vm to unbind vma's without lock (Maarten) - s/engine->i915/i915/ for DG2 engine workarounds (Matt R) - Use to_gt() helper for GGTT accesses (Michal Wi.) - Selftest improvements (Matt B., Thomas, Ram) - Coding style and compiler warning fixes (Matt B., Jasmine, Andi, Colin, Gustavo, Dan) From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/Yg4i2aCZvvee5Eai@jlahtine-mobl.ger.corp.intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> [Fixed conflicts while applying, using the fixups/drm-intel-gt-next.patch from drm-rerere's 1f2b1742abdd ("2022y-02m-23d-16h-07m-57s UTC: drm-tip rerere cache update")]
149 lines
3.6 KiB
C
149 lines
3.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
|
|
#ifndef _VKMS_DRV_H_
|
|
#define _VKMS_DRV_H_
|
|
|
|
#include <linux/hrtimer.h>
|
|
|
|
#include <drm/drm.h>
|
|
#include <drm/drm_gem.h>
|
|
#include <drm/drm_gem_atomic_helper.h>
|
|
#include <drm/drm_encoder.h>
|
|
#include <drm/drm_writeback.h>
|
|
|
|
#define XRES_MIN 20
|
|
#define YRES_MIN 20
|
|
|
|
#define XRES_DEF 1024
|
|
#define YRES_DEF 768
|
|
|
|
#define XRES_MAX 8192
|
|
#define YRES_MAX 8192
|
|
|
|
#define NUM_OVERLAY_PLANES 8
|
|
|
|
struct vkms_writeback_job {
|
|
struct iosys_map map[DRM_FORMAT_MAX_PLANES];
|
|
struct iosys_map data[DRM_FORMAT_MAX_PLANES];
|
|
};
|
|
|
|
struct vkms_composer {
|
|
struct drm_framebuffer fb;
|
|
struct drm_rect src, dst;
|
|
struct iosys_map map[4];
|
|
unsigned int offset;
|
|
unsigned int pitch;
|
|
unsigned int cpp;
|
|
};
|
|
|
|
/**
|
|
* vkms_plane_state - Driver specific plane state
|
|
* @base: base plane state
|
|
* @composer: data required for composing computation
|
|
*/
|
|
struct vkms_plane_state {
|
|
struct drm_shadow_plane_state base;
|
|
struct vkms_composer *composer;
|
|
};
|
|
|
|
struct vkms_plane {
|
|
struct drm_plane base;
|
|
};
|
|
|
|
/**
|
|
* vkms_crtc_state - Driver specific CRTC state
|
|
* @base: base CRTC state
|
|
* @composer_work: work struct to compose and add CRC entries
|
|
* @n_frame_start: start frame number for computed CRC
|
|
* @n_frame_end: end frame number for computed CRC
|
|
*/
|
|
struct vkms_crtc_state {
|
|
struct drm_crtc_state base;
|
|
struct work_struct composer_work;
|
|
|
|
int num_active_planes;
|
|
/* stack of active planes for crc computation, should be in z order */
|
|
struct vkms_plane_state **active_planes;
|
|
struct vkms_writeback_job *active_writeback;
|
|
|
|
/* below four are protected by vkms_output.composer_lock */
|
|
bool crc_pending;
|
|
bool wb_pending;
|
|
u64 frame_start;
|
|
u64 frame_end;
|
|
};
|
|
|
|
struct vkms_output {
|
|
struct drm_crtc crtc;
|
|
struct drm_encoder encoder;
|
|
struct drm_connector connector;
|
|
struct drm_writeback_connector wb_connector;
|
|
struct hrtimer vblank_hrtimer;
|
|
ktime_t period_ns;
|
|
struct drm_pending_vblank_event *event;
|
|
/* ordered wq for composer_work */
|
|
struct workqueue_struct *composer_workq;
|
|
/* protects concurrent access to composer */
|
|
spinlock_t lock;
|
|
|
|
/* protected by @lock */
|
|
bool composer_enabled;
|
|
struct vkms_crtc_state *composer_state;
|
|
|
|
spinlock_t composer_lock;
|
|
};
|
|
|
|
struct vkms_device;
|
|
|
|
struct vkms_config {
|
|
bool writeback;
|
|
bool cursor;
|
|
bool overlay;
|
|
/* only set when instantiated */
|
|
struct vkms_device *dev;
|
|
};
|
|
|
|
struct vkms_device {
|
|
struct drm_device drm;
|
|
struct platform_device *platform;
|
|
struct vkms_output output;
|
|
const struct vkms_config *config;
|
|
};
|
|
|
|
#define drm_crtc_to_vkms_output(target) \
|
|
container_of(target, struct vkms_output, crtc)
|
|
|
|
#define drm_device_to_vkms_device(target) \
|
|
container_of(target, struct vkms_device, drm)
|
|
|
|
#define to_vkms_crtc_state(target)\
|
|
container_of(target, struct vkms_crtc_state, base)
|
|
|
|
#define to_vkms_plane_state(target)\
|
|
container_of(target, struct vkms_plane_state, base.base)
|
|
|
|
/* CRTC */
|
|
int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
|
|
struct drm_plane *primary, struct drm_plane *cursor);
|
|
|
|
int vkms_output_init(struct vkms_device *vkmsdev, int index);
|
|
|
|
struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
|
|
enum drm_plane_type type, int index);
|
|
|
|
/* CRC Support */
|
|
const char *const *vkms_get_crc_sources(struct drm_crtc *crtc,
|
|
size_t *count);
|
|
int vkms_set_crc_source(struct drm_crtc *crtc, const char *src_name);
|
|
int vkms_verify_crc_source(struct drm_crtc *crtc, const char *source_name,
|
|
size_t *values_cnt);
|
|
|
|
/* Composer Support */
|
|
void vkms_composer_worker(struct work_struct *work);
|
|
void vkms_set_composer(struct vkms_output *out, bool enabled);
|
|
|
|
/* Writeback */
|
|
int vkms_enable_writeback_connector(struct vkms_device *vkmsdev);
|
|
|
|
#endif /* _VKMS_DRV_H_ */
|