Permalink
Browse files

and get more files to compile on bsd

  • Loading branch information...
1 parent 5cda219 commit cf658097f96667cb0a1d75b5b41f53d2808bb87b @mlankhorst mlankhorst committed Apr 5, 2012
View
@@ -2,9 +2,9 @@
KMOD= pscnv
HEADERS= nouveau_bios.h nouveau_connector.h nouveau_crtc.h nouveau_dma.h nouveau_drv.h nouveau_encoder.h nouveau_fb.h nouveau_fbcon.h nouveau_grctx.h nouveau_hw.h nouveau_hwsq.h nouveau_i2c.h nouveau_pm.h nouveau_reg.h nv50_chan.h nv50_display.h nv50_evo.h nv50_vm.h nvc0_chan.h nvc0_copy.h nvc0_graph.h nvc0_pgraph.xml.h nvc0_vm.h nvreg.h pscnv_chan.h pscnv_drm.h pscnv_engine.h pscnv_fifo.h pscnv_gem.h pscnv_ioctl.h pscnv_mem.h pscnv_mm.h pscnv_ramht.h pscnv_tree.h pscnv_vm.h
-C_SRCS=nouveau_bios.c nouveau_calc.c nouveau_connector.c nouveau_display.c nouveau_dma.c nouveau_dp.c nouveau_bsddrv.c nouveau_fbcon.c nouveau_hw.c nouveau_i2c.c nouveau_ioc32.c nouveau_irq.c nouveau_mem.c nouveau_perf.c nouveau_pm.c nouveau_state.c nouveau_temp.c nouveau_volt.c nv04_dac.c nv04_dfp.c nv04_pm.c nv04_timer.c nv04_tv.c nv10_gpio.c nv40_counter.c nv50_calc.c nv50_chan.c nv50_crtc.c nv50_cursor.c nv50_dac.c nv50_display.c nv50_fifo.c nv50_gpio.c nv50_graph.c nv50_grctx.c nv50_pm.c nv50_sor.c nv50_vm.c nv50_vram.c nv84_crypt.c nv98_crypt.c nva3_pm.c nvc0_chan.c nvc0_copy.c nvc0_fifo.c nvc0_graph.c nvc0_grctx.c nvc0_pm.c nvc0_vm.c nvc0_vram.c pscnv_chan.c pscnv_gem.c pscnv_ioctl.c pscnv_mem.c pscnv_mm.c pscnv_ramht.c pscnv_sysram.c pscnv_vm.c
+C_SRCS=nouveau_bios.c nouveau_calc.c nouveau_connector.c nouveau_display.c nouveau_dma.c nouveau_dp.c nouveau_bsddrv.c nouveau_fbcon.c nouveau_hw.c nouveau_i2c.c nouveau_irq.c nouveau_mem.c nouveau_perf.c nouveau_pm.c nouveau_state.c nouveau_temp.c nouveau_volt.c nv04_dac.c nv04_dfp.c nv04_pm.c nv04_timer.c nv04_tv.c nv10_gpio.c nv40_counter.c nv50_calc.c nv50_chan.c nv50_crtc.c nv50_cursor.c nv50_dac.c nv50_display.c nv50_fifo.c nv50_gpio.c nv50_graph.c nv50_grctx.c nv50_pm.c nv50_sor.c nv50_vm.c nv50_vram.c nv84_crypt.c nv98_crypt.c nva3_pm.c nvc0_chan.c nvc0_copy.c nvc0_fifo.c nvc0_graph.c nvc0_grctx.c nvc0_pm.c nvc0_vm.c nvc0_vram.c pscnv_chan.c pscnv_gem.c pscnv_ioctl.c pscnv_mem.c pscnv_mm.c pscnv_ramht.c pscnv_sysram.c pscnv_vm.c
SRCS=$(HEADERS) $(C_SRCS) bus_if.h device_if.h pci_if.h opt_drm.h vnode_if.h
.include <bsd.kmod.mk>
-CFLAGS+=-Wno-pointer-arith -I$(SYSDIR)/dev/drm # -I$(SYSDIR)/ofed/include
+CFLAGS+=-std=gnu99 -Wno-format -Wno-pointer-arith -I$(SYSDIR)/dev/drm # -I$(SYSDIR)/ofed/include
View
@@ -4,5 +4,8 @@ Anything touching i2c:
- i2c methods in nouveau_bios
- hwmon (temperature) support
- nv04 tv/dfp
+- displayport
+Not implemented at all:
+- vga switcheroo / arbiter
View
@@ -35,18 +35,19 @@
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/limits.h>
+#include <sys/kdb.h>
#include "drmP.h"
#define PSCNV_KAPI_GETPARAM_BUS_TYPE
typedef DRM_SPINTYPE spinlock_t;
-#define spinlock_init(lock, name) DRM_SPININIT(lock, name)
-#define spinlock_destroy(lock) DRM_SPINUNINIT(lock)
+#define spin_lock_init(lock) DRM_SPININIT(lock, #lock)
+#define spin_lock_destroy(lock) DRM_SPINUNINIT(lock)
#define spin_lock(lock) DRM_SPINLOCK(lock)
#define spin_unlock(lock) DRM_SPINUNLOCK(lock)
#define spin_lock_irqsave(lock, flags) DRM_SPINLOCK_IRQSAVE(lock, flags)
-#define spin_unlock_irqrestore(lock, flags) DRM_SPINLOCK_IRQRESTORE(lock, flags)
+#define spin_unlock_irqrestore(lock, flags) DRM_SPINUNLOCK_IRQRESTORE(lock, flags)
#define kfree(x) drm_free(x, 0, DRM_MEM_DRIVER)
#define kzalloc(x, y) drm_calloc(x, 1, DRM_MEM_DRIVER)
@@ -66,6 +67,23 @@ struct vm_area_struct {};
#define ioread32(x) (*(volatile u_int32_t*)(x))
#define iowrite32(y, x) ((*(volatile u_int32_t*)(x)) = (y))
+#ifndef HZ
+#define HZ hz
+#endif
+
+#define WARN(arg1, args...) do { \
+ printf("%s:%d/%s " arg1, \
+ __FILE__, __LINE__, __FUNCTION__, ##args); \
+ kdb_backtrace(); \
+ } while (0)
+#define BUG() WARN("")
+#define WARN_ON(x,y,z...) do { if ((x)) WARN(y, ##z); } while (0)
+#define BUG_ON(x) WARN_ON(x, "")
+
+#ifndef __must_check
+#define __must_check
+#endif
+
#ifndef _LINUX_DELAY_H_
#define _LINUX_DELAY_H_
View
@@ -28,6 +28,7 @@
#include "nouveau_drv.h"
#include "nouveau_dma.h"
+#if 0
void
nouveau_dma_pre_init(struct nouveau_channel *chan)
{
@@ -38,7 +39,6 @@ nouveau_dma_pre_init(struct nouveau_channel *chan)
chan->dma.free = chan->dma.max - chan->dma.cur;
}
-#if 0
void
OUT_RINGp(struct nouveau_channel *chan, const void *data, unsigned nr_dwords)
{
View
@@ -22,12 +22,12 @@
* Authors: Ben Skeggs
*/
-#include <linux/module.h>
#include "nouveau_drv.h"
#include "nouveau_i2c.h"
#include "nouveau_hw.h"
#ifdef __linux__
+#include <linux/module.h>
static void
nv04_i2c_setscl(void *data, int state)
View
@@ -29,8 +29,10 @@
#include "drm.h"
#include "drm_sarea.h"
#include "drm_crtc_helper.h"
+#ifdef __linux__
#include <linux/vgaarb.h>
#include <linux/vga_switcheroo.h>
+#endif
#include "pscnv_drm.h"
#include "nouveau_reg.h"
@@ -152,6 +154,7 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
return 0;
}
+#ifdef __linux__
static unsigned int
nouveau_vga_set_decode(void *priv, bool state)
{
@@ -199,6 +202,7 @@ static bool nouveau_switcheroo_can_switch(struct pci_dev *pdev)
spin_unlock(&dev->count_lock);
return can_switch;
}
+#endif
int
nouveau_card_init(struct drm_device *dev)
View
@@ -4,7 +4,7 @@
#include "pscnv_chan.h"
#include "nv50_vm.h"
-int nv50_chan_new (struct pscnv_chan *ch) {
+static int nv50_chan_new (struct pscnv_chan *ch) {
struct pscnv_vspace *vs = ch->vspace;
struct drm_nouveau_private *dev_priv = ch->dev->dev_private;
uint64_t size;
@@ -139,7 +139,7 @@ nv50_chan_dmaobj_new(struct pscnv_chan *ch, uint32_t type, uint64_t start, uint6
return res;
}
-void nv50_chan_free(struct pscnv_chan *ch) {
+static void nv50_chan_free(struct pscnv_chan *ch) {
struct drm_nouveau_private *dev_priv = ch->dev->dev_private;
unsigned long flags;
spin_lock_irqsave(&dev_priv->chan->ch_lock, flags);
@@ -153,7 +153,7 @@ void nv50_chan_free(struct pscnv_chan *ch) {
mutex_unlock(&ch->vspace->lock);
}
-void
+static void
nv50_chan_takedown(struct drm_device *dev) {
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nv50_chan_engine *che = nv50_ch(dev_priv->chan);
View
@@ -5,9 +5,9 @@
#include "nv50_chan.h"
#include "pscnv_chan.h"
-int nv50_vm_map_kernel(struct pscnv_bo *bo);
-void nv50_vm_takedown(struct drm_device *dev);
-int nv50_vspace_do_unmap (struct pscnv_vspace *vs, uint64_t offset, uint64_t length);
+static int nv50_vm_map_kernel(struct pscnv_bo *bo);
+static void nv50_vm_takedown(struct drm_device *dev);
+static int nv50_vspace_do_unmap (struct pscnv_vspace *vs, uint64_t offset, uint64_t length);
int
nv50_vm_flush(struct drm_device *dev, int unit) {
@@ -19,7 +19,7 @@ nv50_vm_flush(struct drm_device *dev, int unit) {
return 0;
}
-int nv50_vspace_tlb_flush (struct pscnv_vspace *vs) {
+static int nv50_vspace_tlb_flush (struct pscnv_vspace *vs) {
struct drm_nouveau_private *dev_priv = vs->dev->dev_private;
int i, ret;
nv50_vm_flush(vs->dev, 5); /* PFIFO always active */
@@ -63,7 +63,7 @@ nv50_vspace_fill_pd_slot (struct pscnv_vspace *vs, uint32_t pdenum) {
return 0;
}
-int
+static int
nv50_vspace_place_map (struct pscnv_vspace *vs, struct pscnv_bo *bo,
uint64_t start, uint64_t end, int back,
struct pscnv_mm_node **res) {
@@ -98,7 +98,7 @@ static int nv50_vspace_map_contig_range (struct pscnv_vspace *vs, uint64_t offse
return 0;
}
-int
+static int
nv50_vspace_do_map (struct pscnv_vspace *vs, struct pscnv_bo *bo, uint64_t offset) {
struct drm_nouveau_private *dev_priv = vs->dev->dev_private;
struct pscnv_mm_node *n;
@@ -147,7 +147,7 @@ nv50_vspace_do_map (struct pscnv_vspace *vs, struct pscnv_bo *bo, uint64_t offse
return 0;
}
-int
+static int
nv50_vspace_do_unmap (struct pscnv_vspace *vs, uint64_t offset, uint64_t length) {
struct drm_nouveau_private *dev_priv = vs->dev->dev_private;
while (length) {
@@ -169,7 +169,7 @@ nv50_vspace_do_unmap (struct pscnv_vspace *vs, uint64_t offset, uint64_t length)
return 0;
}
-int nv50_vspace_new(struct pscnv_vspace *vs) {
+static int nv50_vspace_new(struct pscnv_vspace *vs) {
int ret;
/* XXX: could actually use it some day... */
@@ -188,7 +188,7 @@ int nv50_vspace_new(struct pscnv_vspace *vs) {
return ret;
}
-void nv50_vspace_free(struct pscnv_vspace *vs) {
+static void nv50_vspace_free(struct pscnv_vspace *vs) {
int i;
for (i = 0; i < NV50_VM_PDE_COUNT; i++) {
if (nv50_vs(vs)->pt[i]) {
@@ -198,23 +198,23 @@ void nv50_vspace_free(struct pscnv_vspace *vs) {
kfree(vs->engdata);
}
-int nv50_vm_map_user(struct pscnv_bo *bo) {
+static int nv50_vm_map_user(struct pscnv_bo *bo) {
struct drm_nouveau_private *dev_priv = bo->dev->dev_private;
struct nv50_vm_engine *vme = nv50_vm(dev_priv->vm);
if (bo->map1)
return 0;
return pscnv_vspace_map(vme->barvm, bo, 0, dev_priv->fb_size, 0, &bo->map1);
}
-int nv50_vm_map_kernel(struct pscnv_bo *bo) {
+static int nv50_vm_map_kernel(struct pscnv_bo *bo) {
struct drm_nouveau_private *dev_priv = bo->dev->dev_private;
struct nv50_vm_engine *vme = nv50_vm(dev_priv->vm);
if (bo->map3)
return 0;
return pscnv_vspace_map(vme->barvm, bo, dev_priv->fb_size, dev_priv->fb_size + dev_priv->ramin_size, 0, &bo->map3);
}
-void
+static void
nv50_vm_bar_flush(struct drm_device *dev) {
nv_wr32(dev, 0x330c, 1);
if (!nouveau_wait_until(dev, 2000000000ULL, 0x330c, 2, 0)) {
@@ -296,7 +296,7 @@ nv50_vm_init(struct drm_device *dev) {
return 0;
}
-void
+static void
nv50_vm_takedown(struct drm_device *dev) {
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nv50_vm_engine *vme = nv50_vm(dev_priv->vm);
View
@@ -4,7 +4,7 @@
#include "pscnv_chan.h"
#include "nvc0_vm.h"
-int nvc0_chan_new (struct pscnv_chan *ch)
+static int nvc0_chan_new (struct pscnv_chan *ch)
{
struct pscnv_vspace *vs = ch->vspace;
struct drm_nouveau_private *dev_priv = ch->dev->dev_private;
@@ -37,7 +37,7 @@ int nvc0_chan_new (struct pscnv_chan *ch)
return 0;
}
-void nvc0_chan_free(struct pscnv_chan *ch)
+static void nvc0_chan_free(struct pscnv_chan *ch)
{
struct drm_nouveau_private *dev_priv = ch->dev->dev_private;
unsigned long flags;
@@ -47,7 +47,7 @@ void nvc0_chan_free(struct pscnv_chan *ch)
pscnv_mem_free(ch->bo);
}
-void
+static void
nvc0_chan_takedown(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
View
@@ -78,7 +78,7 @@ nvc0_copy_chan_alloc(struct pscnv_engine *eng, struct pscnv_chan *ch)
return ret;
}
-void
+static void
nvc0_copy_chan_kill(struct pscnv_engine *eng, struct pscnv_chan *ch)
{
/* FIXME */
@@ -116,7 +116,7 @@ nvc0_copy_chan_free(struct pscnv_engine *eng, struct pscnv_chan *ch)
ch->engdata[PSCNV_ENGINE_COPY + pcopy->id] = NULL;
}
-void
+static void
nvc0_copy_takedown(struct pscnv_engine *eng)
{
struct drm_device *dev = eng->dev;
View
@@ -29,15 +29,13 @@
#include "pscnv_vm.h"
#include "pscnv_chan.h"
#include "nvc0_vm.h"
-#include <linux/list.h>
#define PSCNV_GEM_NOUSER 0x10 /* XXX */
-int nvc0_vm_map_kernel(struct pscnv_bo *bo);
-void nvc0_vm_takedown(struct drm_device *dev);
-void nv84_vm_bar_flush(struct drm_device *dev);
+static int nvc0_vm_map_kernel(struct pscnv_bo *bo);
+static void nvc0_vm_takedown(struct drm_device *dev);
-int
+static int
nvc0_tlb_flush(struct pscnv_vspace *vs)
{
struct drm_device *dev = vs->dev;
@@ -129,7 +127,7 @@ nvc0_vspace_pgt(struct pscnv_vspace *vs, unsigned int pde)
return pt;
}
-void
+static void
nvc0_pgt_del(struct pscnv_vspace *vs, struct nvc0_pgt *pgt)
{
pscnv_vram_free(pgt->bo[1]);
@@ -143,7 +141,7 @@ nvc0_pgt_del(struct pscnv_vspace *vs, struct nvc0_pgt *pgt)
kfree(pgt);
}
-int
+static int
nvc0_vspace_do_unmap(struct pscnv_vspace *vs, uint64_t offset, uint64_t size)
{
struct drm_nouveau_private *dev_priv = vs->dev->dev_private;
@@ -190,7 +188,7 @@ write_pt(struct pscnv_bo *pt, int pte, int count, uint64_t phys,
}
}
-int
+static int
nvc0_vspace_place_map (struct pscnv_vspace *vs, struct pscnv_bo *bo,
uint64_t start, uint64_t end, int back,
struct pscnv_mm_node **res)
@@ -205,7 +203,7 @@ nvc0_vspace_place_map (struct pscnv_vspace *vs, struct pscnv_bo *bo,
return pscnv_mm_alloc(vs->mm, bo->size, flags, start, end, res);
}
-int
+static int
nvc0_vspace_do_map(struct pscnv_vspace *vs,
struct pscnv_bo *bo, uint64_t offset)
{
@@ -284,7 +282,7 @@ nvc0_vspace_do_map(struct pscnv_vspace *vs,
return nvc0_tlb_flush(vs);
}
-int nvc0_vspace_new(struct pscnv_vspace *vs) {
+static int nvc0_vspace_new(struct pscnv_vspace *vs) {
int i, ret;
if (vs->size > 1ull << 40)
@@ -322,7 +320,7 @@ int nvc0_vspace_new(struct pscnv_vspace *vs) {
return ret;
}
-void nvc0_vspace_free(struct pscnv_vspace *vs) {
+static void nvc0_vspace_free(struct pscnv_vspace *vs) {
int i;
for (i = 0; i < NVC0_PDE_HT_SIZE; i++) {
struct nvc0_pgt *pgt, *save;
@@ -334,15 +332,15 @@ void nvc0_vspace_free(struct pscnv_vspace *vs) {
kfree(vs->engdata);
}
-int nvc0_vm_map_user(struct pscnv_bo *bo) {
+static int nvc0_vm_map_user(struct pscnv_bo *bo) {
struct drm_nouveau_private *dev_priv = bo->dev->dev_private;
struct nvc0_vm_engine *vme = nvc0_vm(dev_priv->vm);
if (bo->map1)
return 0;
return pscnv_vspace_map(vme->bar1vm, bo, 0, dev_priv->fb_size, 0, &bo->map1);
}
-int nvc0_vm_map_kernel(struct pscnv_bo *bo) {
+static int nvc0_vm_map_kernel(struct pscnv_bo *bo) {
struct drm_nouveau_private *dev_priv = bo->dev->dev_private;
struct nvc0_vm_engine *vme = nvc0_vm(dev_priv->vm);
if (bo->map3)
View
@@ -158,7 +158,7 @@ int pscnv_ioctl_gem_info(struct drm_device *dev, void *data,
return 0;
}
-struct pscnv_vspace *
+static struct pscnv_vspace *
pscnv_get_vspace(struct drm_device *dev, struct drm_file *file_priv, int vid)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
Oops, something went wrong.

0 comments on commit cf65809

Please sign in to comment.