2012-07-06 10:14:00 +08:00
|
|
|
#ifndef __NOUVEAU_DRMCLI_H__
|
|
|
|
#define __NOUVEAU_DRMCLI_H__
|
|
|
|
|
2012-07-31 14:16:21 +08:00
|
|
|
#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"
|
|
|
|
#define DRIVER_DATE "20120801"
|
|
|
|
|
|
|
|
#define DRIVER_MAJOR 1
|
|
|
|
#define DRIVER_MINOR 1
|
2013-03-28 05:25:52 +08:00
|
|
|
#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).
|
|
|
|
*/
|
2012-07-31 14:16:21 +08:00
|
|
|
|
2012-07-06 10:14:00 +08:00
|
|
|
#include <core/client.h>
|
2013-01-31 07:23:34 +08:00
|
|
|
#include <core/event.h>
|
2012-07-06 10:14:00 +08:00
|
|
|
|
2012-07-20 06:17:34 +08:00
|
|
|
#include <subdev/vm.h>
|
|
|
|
|
2012-07-06 10:14:00 +08:00
|
|
|
#include <drmP.h>
|
|
|
|
#include <drm/nouveau_drm.h>
|
|
|
|
|
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm merge (part 1) from Dave Airlie:
"So first of all my tree and uapi stuff has a conflict mess, its my
fault as the nouveau stuff didn't hit -next as were trying to rebase
regressions out of it before we merged.
Highlights:
- SH mobile modesetting driver and associated helpers
- some DRM core documentation
- i915 modesetting rework, haswell hdmi, haswell and vlv fixes, write
combined pte writing, ilk rc6 support,
- nouveau: major driver rework into a hw core driver, makes features
like SLI a lot saner to implement,
- psb: add eDP/DP support for Cedarview
- radeon: 2 layer page tables, async VM pte updates, better PLL
selection for > 2 screens, better ACPI interactions
The rest is general grab bag of fixes.
So why part 1? well I have the exynos pull req which came in a bit
late but was waiting for me to do something they shouldn't have and it
looks fairly safe, and David Howells has some more header cleanups
he'd like me to pull, that seem like a good idea, but I'd like to get
this merge out of the way so -next dosen't get blocked."
Tons of conflicts mostly due to silly include line changes, but mostly
mindless. A few other small semantic conflicts too, noted from Dave's
pre-merged branch.
* 'drm-next' of git://people.freedesktop.org/~airlied/linux: (447 commits)
drm/nv98/crypt: fix fuc build with latest envyas
drm/nouveau/devinit: fixup various issues with subdev ctor/init ordering
drm/nv41/vm: fix and enable use of "real" pciegart
drm/nv44/vm: fix and enable use of "real" pciegart
drm/nv04/dmaobj: fixup vm target handling in preparation for nv4x pcie
drm/nouveau: store supported dma mask in vmmgr
drm/nvc0/ibus: initial implementation of subdev
drm/nouveau/therm: add support for fan-control modes
drm/nouveau/hwmon: rename pwm0* to pmw1* to follow hwmon's rules
drm/nouveau/therm: calculate the pwm divisor on nv50+
drm/nouveau/fan: rewrite the fan tachometer driver to get more precision, faster
drm/nouveau/therm: move thermal-related functions to the therm subdev
drm/nouveau/bios: parse the pwm divisor from the perf table
drm/nouveau/therm: use the EXTDEV table to detect i2c monitoring devices
drm/nouveau/therm: rework thermal table parsing
drm/nouveau/gpio: expose the PWM/TOGGLE parameter found in the gpio vbios table
drm/nouveau: fix pm initialization order
drm/nouveau/bios: check that fixed tvdac gpio data is valid before using it
drm/nouveau: log channel debug/error messages from client object rather than drm client
drm/nouveau: have drm debugging macros build on top of core macros
...
2012-10-04 14:29:23 +08:00
|
|
|
#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>
|
2012-07-20 06:17:34 +08:00
|
|
|
|
|
|
|
struct nouveau_channel;
|
|
|
|
|
|
|
|
#define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
|
|
|
|
|
|
|
|
#include "nouveau_fence.h"
|
2012-07-31 14:16:21 +08:00
|
|
|
#include "nouveau_bios.h"
|
2012-07-20 06:17:34 +08:00
|
|
|
|
|
|
|
struct nouveau_drm_tile {
|
|
|
|
struct nouveau_fence *fence;
|
|
|
|
bool used;
|
|
|
|
};
|
|
|
|
|
2012-07-06 10:14:00 +08:00
|
|
|
enum nouveau_drm_handle {
|
|
|
|
NVDRM_CLIENT = 0xffffffff,
|
|
|
|
NVDRM_DEVICE = 0xdddddddd,
|
2012-07-20 06:17:34 +08:00
|
|
|
NVDRM_PUSH = 0xbbbb0000, /* |= client chid */
|
|
|
|
NVDRM_CHAN = 0xcccc0000, /* |= client chid */
|
2012-07-06 10:14:00 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct nouveau_cli {
|
|
|
|
struct nouveau_client base;
|
|
|
|
struct list_head head;
|
|
|
|
struct mutex mutex;
|
2012-07-20 06:17:34 +08:00
|
|
|
void *abi16;
|
2012-07-06 10:14:00 +08:00
|
|
|
};
|
|
|
|
|
2012-07-20 06:17:34 +08:00
|
|
|
static inline struct nouveau_cli *
|
|
|
|
nouveau_cli(struct drm_file *fpriv)
|
|
|
|
{
|
|
|
|
return fpriv ? fpriv->driver_priv : NULL;
|
|
|
|
}
|
|
|
|
|
2012-09-10 12:20:51 +08:00
|
|
|
extern int nouveau_runtime_pm;
|
|
|
|
|
2012-07-06 10:14:00 +08:00
|
|
|
struct nouveau_drm {
|
|
|
|
struct nouveau_cli client;
|
|
|
|
struct drm_device *dev;
|
|
|
|
|
|
|
|
struct nouveau_object *device;
|
|
|
|
struct list_head clients;
|
2012-07-11 08:44:20 +08:00
|
|
|
|
|
|
|
struct {
|
|
|
|
enum {
|
|
|
|
UNKNOWN = 0,
|
|
|
|
DISABLE = 1,
|
|
|
|
ENABLED = 2
|
|
|
|
} stat;
|
|
|
|
u32 base;
|
|
|
|
u32 size;
|
|
|
|
} agp;
|
2012-07-20 06:17:34 +08:00
|
|
|
|
|
|
|
/* 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 *);
|
2013-07-08 08:40:35 +08:00
|
|
|
struct nouveau_channel *chan;
|
2012-07-20 06:17:34 +08:00
|
|
|
int mtrr;
|
|
|
|
} ttm;
|
|
|
|
|
|
|
|
/* GEM interface support */
|
|
|
|
struct {
|
|
|
|
u64 vram_available;
|
|
|
|
u64 gart_available;
|
|
|
|
} gem;
|
|
|
|
|
|
|
|
/* synchronisation */
|
|
|
|
void *fence;
|
|
|
|
|
|
|
|
/* context for accelerated drm-internal operations */
|
2012-08-06 17:38:25 +08:00
|
|
|
struct nouveau_channel *cechan;
|
2012-07-20 06:17:34 +08:00
|
|
|
struct nouveau_channel *channel;
|
|
|
|
struct nouveau_gpuobj *notify;
|
|
|
|
struct nouveau_fbdev *fbcon;
|
|
|
|
|
|
|
|
/* nv10-nv40 tiling regions */
|
|
|
|
struct {
|
|
|
|
struct nouveau_drm_tile reg[15];
|
|
|
|
spinlock_t lock;
|
|
|
|
} tile;
|
2012-07-26 07:12:47 +08:00
|
|
|
|
2012-07-31 14:16:21 +08:00
|
|
|
/* modesetting */
|
|
|
|
struct nvbios vbios;
|
|
|
|
struct nouveau_display *display;
|
2012-07-26 07:12:47 +08:00
|
|
|
struct backlight_device *backlight;
|
2013-03-24 19:56:30 +08:00
|
|
|
struct nouveau_eventh vblank[4];
|
2012-07-31 14:16:21 +08:00
|
|
|
|
|
|
|
/* power management */
|
|
|
|
struct nouveau_pm *pm;
|
2012-09-10 12:20:51 +08:00
|
|
|
|
|
|
|
/* display power reference */
|
|
|
|
bool have_disp_power_ref;
|
|
|
|
|
|
|
|
struct dev_pm_domain vga_pm_domain;
|
|
|
|
struct pci_dev *hdmi_device;
|
2012-07-06 10:14:00 +08:00
|
|
|
};
|
|
|
|
|
2012-07-20 06:17:34 +08:00
|
|
|
static inline struct nouveau_drm *
|
|
|
|
nouveau_drm(struct drm_device *dev)
|
|
|
|
{
|
2012-07-31 14:16:21 +08:00
|
|
|
return dev->dev_private;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct nouveau_device *
|
|
|
|
nouveau_dev(struct drm_device *dev)
|
|
|
|
{
|
|
|
|
return nv_device(nouveau_drm(dev)->device);
|
2012-07-20 06:17:34 +08:00
|
|
|
}
|
|
|
|
|
2012-11-02 09:04:28 +08:00
|
|
|
int nouveau_pmops_suspend(struct device *);
|
|
|
|
int nouveau_pmops_resume(struct device *);
|
2012-07-06 10:14:00 +08:00
|
|
|
|
2012-09-10 12:20:51 +08:00
|
|
|
#define NV_SUSPEND(cli, fmt, args...) nv_suspend((cli), fmt, ##args)
|
2012-09-12 11:38:13 +08:00
|
|
|
#define NV_FATAL(cli, fmt, args...) nv_fatal((cli), fmt, ##args)
|
|
|
|
#define NV_ERROR(cli, fmt, args...) nv_error((cli), fmt, ##args)
|
|
|
|
#define NV_WARN(cli, fmt, args...) nv_warn((cli), fmt, ##args)
|
|
|
|
#define NV_INFO(cli, fmt, args...) nv_info((cli), fmt, ##args)
|
|
|
|
#define NV_DEBUG(cli, fmt, args...) do { \
|
2012-07-06 10:14:00 +08:00
|
|
|
if (drm_debug & DRM_UT_DRIVER) \
|
2012-09-12 11:38:13 +08:00
|
|
|
nv_info((cli), fmt, ##args); \
|
2012-07-06 10:14:00 +08:00
|
|
|
} while (0)
|
|
|
|
|
2012-10-31 10:11:15 +08:00
|
|
|
extern int nouveau_modeset;
|
|
|
|
|
2012-07-06 10:14:00 +08:00
|
|
|
#endif
|