mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-12-25 23:50:45 +00:00
-----BEGIN PGP SIGNATURE-----
iQIcBAABAgAGBQJaCm8RAAoJEAx081l5xIa+zX0QAJSm31kCG3vdw2CNiRx25L3q
3hcsEOgAjVJ9FQVGKFWjzb8TK35tSqtNx5kWIj0VGaIfBE5Bdg5SLLgKKUYas8rY
4LaphqICq2uxu2BNa2tpiar/sHhAnuozwQ4czpVWXzlaISnb9yYzRl7gMuyUVGkx
+Gih5VUhLmQC0HsRTLJ3vaZQoUsLAl2gAjKcWa1bx57j2S+iKOPfsLaq7VYo+y1I
Njc+iSGqMhJzRLXVkxL2lQKaslp7R38Bbh5K4Kvyjkm4Aq7zErOF6irpOXKMcrGl
mwnr89vf1G9thjikrBaXpKnuvdbWYveoN/ORMlTdCfxkFnChHLnm3bd7NJ49RXDN
Hv/Iq9YYjmZ9GTatxnx7lWtmXnZXC5he1yn1JAuz/yt7/0b/Wx+Mu/wEpBXYNFTd
1AZdD586i+AmPo3yDkqH9nBu8JC0W0AnS9VZma4LVvZOP2UfJmj5Im1CLHItbGDN
FnUCkwyD/lJUUk+WgT+w/GOMJgmFHDiFFl4tFtYVVjrUirpCFVguSKG9xuv6tT8P
8iRsoP7RrcmDN9ojN2SEHwcpsAv3HnKkDv+9+GIbWnrGsSbCPq8Qm+JDSvf4h22I
K5lwNpJrcpSKI+q10L7w2xliTBwb98sJkWGA/rssomrdBOWteGZAyqFRYAVgQ+mJ
x/nJurIqQYh2KQN9+uLG
=xVV2
-----END PGP SIGNATURE-----
Merge tag 'drm-for-v4.15' of git://people.freedesktop.org/~airlied/linux
Pull drm updates from Dave Airlie:
"This is the main drm pull request for v4.15.
Core:
- Atomic object lifetime fixes
- Atomic iterator improvements
- Sparse/smatch fixes
- Legacy kms ioctls to be interruptible
- EDID override improvements
- fb/gem helper cleanups
- Simple outreachy patches
- Documentation improvements
- Fix dma-buf rcu races
- DRM mode object leasing for improving VR use cases.
- vgaarb improvements for non-x86 platforms.
New driver:
- tve200: Faraday Technology TVE200 block.
This "TV Encoder" encodes a ITU-T BT.656 stream and can be found in
the StorLink SL3516 (later Cortina Systems CS3516) as well as the
Grain Media GM8180.
New bridges:
- SiI9234 support
New panels:
- S6E63J0X03, OTM8009A, Seiko 43WVF1G, 7" rpi touch panel, Toshiba
LT089AC19000, Innolux AT043TN24
i915:
- Remove Coffeelake from alpha support
- Cannonlake workarounds
- Infoframe refactoring for DisplayPort
- VBT updates
- DisplayPort vswing/emph/buffer translation refactoring
- CCS fixes
- Restore GPU clock boost on missed vblanks
- Scatter list updates for userptr allocations
- Gen9+ transition watermarks
- Display IPC (Isochronous Priority Control)
- Private PAT management
- GVT: improved error handling and pci config sanitizing
- Execlist refactoring
- Transparent Huge Page support
- User defined priorities support
- HuC/GuC firmware refactoring
- DP MST fixes
- eDP power sequencing fixes
- Use RCU instead of stop_machine
- PSR state tracking support
- Eviction fixes
- BDW DP aux channel timeout fixes
- LSPCON fixes
- Cannonlake PLL fixes
amdgpu:
- Per VM BO support
- Powerplay cleanups
- CI powerplay support
- PASID mgr for kfd
- SR-IOV fixes
- initial GPU reset for vega10
- Prime mmap support
- TTM updates
- Clock query interface for Raven
- Fence to handle ioctl
- UVD encode ring support on Polaris
- Transparent huge page DMA support
- Compute LRU pipe tweaks
- BO flag to allow buffers to opt out of implicit sync
- CTX priority setting API
- VRAM lost infrastructure plumbing
qxl:
- fix flicker since atomic rework
amdkfd:
- Further improvements from internal AMD tree
- Usermode events
- Drop radeon support
nouveau:
- Pascal temperature sensor support
- Improved BAR2 handling
- MMU rework to support Pascal MMU
exynos:
- Improved HDMI/mixer support
- HDMI audio interface support
tegra:
- Prep work for tegra186
- Cleanup/fixes
msm:
- Preemption support for a5xx
- Display fixes for 8x96 (snapdragon 820)
- Async cursor plane fixes
- FW loading rework
- GPU debugging improvements
vc4:
- Prep for DSI panels
- fix T-format tiling scanout
- New madvise ioctl
Rockchip:
- LVDS support
omapdrm:
- omap4 HDMI CEC support
etnaviv:
- GPU performance counters groundwork
sun4i:
- refactor driver load + TCON backend
- HDMI improvements
- A31 support
- Misc fixes
udl:
- Probe/EDID read fixes.
tilcdc:
- Misc fixes.
pl111:
- Support more variants
adv7511:
- Improve EDID handling.
- HDMI CEC support
sii8620:
- Add remote control support"
* tag 'drm-for-v4.15' of git://people.freedesktop.org/~airlied/linux: (1480 commits)
drm/rockchip: analogix_dp: Use mutex rather than spinlock
drm/mode_object: fix documentation for object lookups.
drm/i915: Reorder context-close to avoid calling i915_vma_close() under RCU
drm/i915: Move init_clock_gating() back to where it was
drm/i915: Prune the reservation shared fence array
drm/i915: Idle the GPU before shinking everything
drm/i915: Lock llist_del_first() vs llist_del_all()
drm/i915: Calculate ironlake intermediate watermarks correctly, v2.
drm/i915: Disable lazy PPGTT page table optimization for vGPU
drm/i915/execlists: Remove the priority "optimisation"
drm/i915: Filter out spurious execlists context-switch interrupts
drm/amdgpu: use irq-safe lock for kiq->ring_lock
drm/amdgpu: bypass lru touch for KIQ ring submission
drm/amdgpu: Potential uninitialized variable in amdgpu_vm_update_directories()
drm/amdgpu: potential uninitialized variable in amdgpu_vce_ring_parse_cs()
drm/amd/powerplay: initialize a variable before using it
drm/amd/powerplay: suppress KASAN out of bounds warning in vega10_populate_all_memory_levels
drm/amd/amdgpu: fix evicted VRAM bo adjudgement condition
drm/vblank: Tune drm_crtc_accurate_vblank_count() WARN down to a debug
drm/rockchip: add CONFIG_OF dependency for lvds
...
251 lines
6.3 KiB
C
251 lines
6.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __NOUVEAU_DRV_H__
|
|
#define __NOUVEAU_DRV_H__
|
|
|
|
#define DRIVER_AUTHOR "Nouveau Project"
|
|
#define DRIVER_EMAIL "nouveau@lists.freedesktop.org"
|
|
|
|
#define DRIVER_NAME "nouveau"
|
|
#define DRIVER_DESC "nVidia Riva/TNT/GeForce/Quadro/Tesla/Tegra K1+"
|
|
#define DRIVER_DATE "20120801"
|
|
|
|
#define DRIVER_MAJOR 1
|
|
#define DRIVER_MINOR 3
|
|
#define DRIVER_PATCHLEVEL 1
|
|
|
|
/*
|
|
* 1.1.1:
|
|
* - added support for tiled system memory buffer objects
|
|
* - added support for NOUVEAU_GETPARAM_GRAPH_UNITS on [nvc0,nve0].
|
|
* - added support for compressed memory storage types on [nvc0,nve0].
|
|
* - added support for software methods 0x600,0x644,0x6ac on nvc0
|
|
* to control registers on the MPs to enable performance counters,
|
|
* and to control the warp error enable mask (OpenGL requires out of
|
|
* bounds access to local memory to be silently ignored / return 0).
|
|
* 1.1.2:
|
|
* - fixes multiple bugs in flip completion events and timestamping
|
|
* 1.2.0:
|
|
* - object api exposed to userspace
|
|
* - fermi,kepler,maxwell zbc
|
|
* 1.2.1:
|
|
* - allow concurrent access to bo's mapped read/write.
|
|
* 1.2.2:
|
|
* - add NOUVEAU_GEM_DOMAIN_COHERENT flag
|
|
* 1.3.0:
|
|
* - NVIF ABI modified, safe because only (current) users are test
|
|
* programs that get directly linked with NVKM.
|
|
* 1.3.1:
|
|
* - implemented limited ABI16/NVIF interop
|
|
*/
|
|
|
|
#include <linux/notifier.h>
|
|
|
|
#include <nvif/client.h>
|
|
#include <nvif/device.h>
|
|
#include <nvif/ioctl.h>
|
|
#include <nvif/mmu.h>
|
|
#include <nvif/vmm.h>
|
|
|
|
#include <drm/drmP.h>
|
|
|
|
#include <drm/ttm/ttm_bo_api.h>
|
|
#include <drm/ttm/ttm_bo_driver.h>
|
|
#include <drm/ttm/ttm_placement.h>
|
|
#include <drm/ttm/ttm_memory.h>
|
|
#include <drm/ttm/ttm_module.h>
|
|
#include <drm/ttm/ttm_page_alloc.h>
|
|
|
|
#include "uapi/drm/nouveau_drm.h"
|
|
|
|
struct nouveau_channel;
|
|
struct platform_device;
|
|
|
|
#define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
|
|
|
|
#include "nouveau_fence.h"
|
|
#include "nouveau_bios.h"
|
|
#include "nouveau_vmm.h"
|
|
|
|
struct nouveau_drm_tile {
|
|
struct nouveau_fence *fence;
|
|
bool used;
|
|
};
|
|
|
|
enum nouveau_drm_object_route {
|
|
NVDRM_OBJECT_NVIF = NVIF_IOCTL_V0_OWNER_NVIF,
|
|
NVDRM_OBJECT_USIF,
|
|
NVDRM_OBJECT_ABI16,
|
|
NVDRM_OBJECT_ANY = NVIF_IOCTL_V0_OWNER_ANY,
|
|
};
|
|
|
|
enum nouveau_drm_notify_route {
|
|
NVDRM_NOTIFY_NVIF = 0,
|
|
NVDRM_NOTIFY_USIF
|
|
};
|
|
|
|
enum nouveau_drm_handle {
|
|
NVDRM_CHAN = 0xcccc0000, /* |= client chid */
|
|
NVDRM_NVSW = 0x55550000,
|
|
};
|
|
|
|
struct nouveau_cli {
|
|
struct nvif_client base;
|
|
struct nouveau_drm *drm;
|
|
struct mutex mutex;
|
|
|
|
struct nvif_device device;
|
|
struct nvif_mmu mmu;
|
|
struct nouveau_vmm vmm;
|
|
const struct nvif_mclass *mem;
|
|
|
|
struct list_head head;
|
|
void *abi16;
|
|
struct list_head objects;
|
|
struct list_head notifys;
|
|
char name[32];
|
|
|
|
struct work_struct work;
|
|
struct list_head worker;
|
|
struct mutex lock;
|
|
};
|
|
|
|
struct nouveau_cli_work {
|
|
void (*func)(struct nouveau_cli_work *);
|
|
struct nouveau_cli *cli;
|
|
struct list_head head;
|
|
|
|
struct dma_fence *fence;
|
|
struct dma_fence_cb cb;
|
|
};
|
|
|
|
void nouveau_cli_work_queue(struct nouveau_cli *, struct dma_fence *,
|
|
struct nouveau_cli_work *);
|
|
|
|
static inline struct nouveau_cli *
|
|
nouveau_cli(struct drm_file *fpriv)
|
|
{
|
|
return fpriv ? fpriv->driver_priv : NULL;
|
|
}
|
|
|
|
#include <nvif/object.h>
|
|
#include <nvif/device.h>
|
|
|
|
struct nouveau_drm {
|
|
struct nouveau_cli master;
|
|
struct nouveau_cli client;
|
|
struct drm_device *dev;
|
|
|
|
struct list_head clients;
|
|
|
|
struct {
|
|
struct agp_bridge_data *bridge;
|
|
u32 base;
|
|
u32 size;
|
|
bool cma;
|
|
} agp;
|
|
|
|
/* TTM interface support */
|
|
struct {
|
|
struct drm_global_reference mem_global_ref;
|
|
struct ttm_bo_global_ref bo_global_ref;
|
|
struct ttm_bo_device bdev;
|
|
atomic_t validate_sequence;
|
|
int (*move)(struct nouveau_channel *,
|
|
struct ttm_buffer_object *,
|
|
struct ttm_mem_reg *, struct ttm_mem_reg *);
|
|
struct nouveau_channel *chan;
|
|
struct nvif_object copy;
|
|
int mtrr;
|
|
int type_vram;
|
|
int type_host;
|
|
int type_ncoh;
|
|
} ttm;
|
|
|
|
/* GEM interface support */
|
|
struct {
|
|
u64 vram_available;
|
|
u64 gart_available;
|
|
} gem;
|
|
|
|
/* synchronisation */
|
|
void *fence;
|
|
|
|
/* context for accelerated drm-internal operations */
|
|
struct nouveau_channel *cechan;
|
|
struct nouveau_channel *channel;
|
|
struct nvkm_gpuobj *notify;
|
|
struct nouveau_fbdev *fbcon;
|
|
struct nvif_object nvsw;
|
|
struct nvif_object ntfy;
|
|
struct nvif_notify flip;
|
|
|
|
/* nv10-nv40 tiling regions */
|
|
struct {
|
|
struct nouveau_drm_tile reg[15];
|
|
spinlock_t lock;
|
|
} tile;
|
|
|
|
/* modesetting */
|
|
struct nvbios vbios;
|
|
struct nouveau_display *display;
|
|
struct backlight_device *backlight;
|
|
struct list_head bl_connectors;
|
|
struct work_struct hpd_work;
|
|
struct work_struct fbcon_work;
|
|
int fbcon_new_state;
|
|
#ifdef CONFIG_ACPI
|
|
struct notifier_block acpi_nb;
|
|
#endif
|
|
|
|
/* power management */
|
|
struct nouveau_hwmon *hwmon;
|
|
struct nouveau_debugfs *debugfs;
|
|
|
|
/* led management */
|
|
struct nouveau_led *led;
|
|
|
|
/* display power reference */
|
|
bool have_disp_power_ref;
|
|
|
|
struct dev_pm_domain vga_pm_domain;
|
|
struct pci_dev *hdmi_device;
|
|
};
|
|
|
|
static inline struct nouveau_drm *
|
|
nouveau_drm(struct drm_device *dev)
|
|
{
|
|
return dev->dev_private;
|
|
}
|
|
|
|
int nouveau_pmops_suspend(struct device *);
|
|
int nouveau_pmops_resume(struct device *);
|
|
bool nouveau_pmops_runtime(void);
|
|
|
|
#include <nvkm/core/tegra.h>
|
|
|
|
struct drm_device *
|
|
nouveau_platform_device_create(const struct nvkm_device_tegra_func *,
|
|
struct platform_device *, struct nvkm_device **);
|
|
void nouveau_drm_device_remove(struct drm_device *dev);
|
|
|
|
#define NV_PRINTK(l,c,f,a...) do { \
|
|
struct nouveau_cli *_cli = (c); \
|
|
dev_##l(_cli->drm->dev->dev, "%s: "f, _cli->name, ##a); \
|
|
} while(0)
|
|
#define NV_FATAL(drm,f,a...) NV_PRINTK(crit, &(drm)->client, f, ##a)
|
|
#define NV_ERROR(drm,f,a...) NV_PRINTK(err, &(drm)->client, f, ##a)
|
|
#define NV_WARN(drm,f,a...) NV_PRINTK(warn, &(drm)->client, f, ##a)
|
|
#define NV_INFO(drm,f,a...) NV_PRINTK(info, &(drm)->client, f, ##a)
|
|
#define NV_DEBUG(drm,f,a...) do { \
|
|
if (unlikely(drm_debug & DRM_UT_DRIVER)) \
|
|
NV_PRINTK(info, &(drm)->client, f, ##a); \
|
|
} while(0)
|
|
#define NV_ATOMIC(drm,f,a...) do { \
|
|
if (unlikely(drm_debug & DRM_UT_ATOMIC)) \
|
|
NV_PRINTK(info, &(drm)->client, f, ##a); \
|
|
} while(0)
|
|
|
|
extern int nouveau_modeset;
|
|
|
|
#endif
|