summaryrefslogtreecommitdiff
path: root/bsd/drmP.h
AgeCommit message (Expand)Author
2003-12-16Don't ioremap the framebuffer area. The ioremapped area wasn't used byEric Anholt
2003-11-05- Tie the DRM to a specific device: setunique no longer succeeds when givenEric Anholt
2003-11-05Remove buf_alloc which is unused since the locking commit.Eric Anholt
2003-11-04Memory layout transition:Michel Daenzer
2003-10-23- Introduce a new ioctl, DRM_IOCTL_SET_VERSION. This ioctl allows theEric Anholt
2003-10-20Clean up BSD MTRR handling. The NetBSD code is untested, but it's my bestEric Anholt
2003-10-19- SMPng lock the DRM. This is only partial -- there are a few code pathsEric Anholt
2003-10-17- Move IRQ functions from drm_dma.h to new drm_irq.h and disentangle themEric Anholt
2003-10-17- Converted Linux drivers to initialize DRM instances based on PCI IDs, notEric Anholt
2003-10-02Axe more old gamma DMA infrastructure.Eric Anholt
2003-08-29Add DRM(calloc), which is convenient, used by the new sis code, and takesEric Anholt
2003-08-19- Remove $FreeBSD$ tags as they weren't too useful and merges are now beingEric Anholt
2003-07-29IRQ code cleanup suggested by Linus TorvaldsMichel Daenzer
2003-07-25Compile fixes for recent 2.5/2.6 Linux kernels. I hope this doesn't breakMichel Daenzer
2003-05-16Support AGP bridges where the AGP aperture can't be accessed directly byMichel Daenzer
2003-04-26Add PCI DMA memory functions and make addbufs_pci and associated code useEric Anholt
2003-04-26Move the memory functions with debugging info to drm_memory_debug.h, andEric Anholt
2003-04-25Merge from FreeBSD-current.Eric Anholt
2003-04-24Remove more gamma DMA infrastructure. Most of this code was copied straightEric Anholt
2003-04-24Remove more gamma DMA code. This isn't all of it, but it's a major portion.Eric Anholt
2003-04-24Move some common code from addbufs_<type> to addbufs. Make buf_alloc beEric Anholt
2003-04-24Remove the ioctl_count variable from the device. A reference is held to theEric Anholt
2003-04-24Remove a bunch of dead code and fix spelling of a couple of comments.Eric Anholt
2003-04-24Move one definition to drm_drv.h and remove the rest of drm_init.h whichEric Anholt
2003-04-24Remove DRM_DMA_HISTOGRAM and associated code.Eric Anholt
2003-04-24Make DRM(read) and DRM(poll) stubs and remove DRM(write) andEric Anholt
2003-03-29Remove dead vma code and remove the unused devstate struct definition.Eric Anholt
2003-03-29Add DRMFILE definitions and supply filp for BSD in theEric Anholt
2003-03-11Merge back from FreeBSD-current, adding FreeBSD ID tags to aid futureEric Anholt
2003-03-06Remove the vbl signal code because it's untested (and has lock issues onEric Anholt
2003-02-21Merge from bsd-4-0-0-branch.Eric Anholt
2002-12-06Add vblank signal code for BSD DRM. Untested so far, but working with aEric Anholt
2002-10-29Use bus_alloc_resource/bus_release_resource more properly: save the ridEric Anholt
2002-09-26BSD vblank framework.Eric Anholt
2002-07-05merged bsd-3-0-0-branchAlan Hourihane
2002-03-06first pass at merging mesa 4.0 kernel drivers into new bsd-3-0-0 branch.Alan Hourihane
2002-01-27First pass merge of XFree86 4.2.0 import.David Dawes
2001-04-09First pass of XFree86 4.0.99.2 merge.David Dawes
2000-07-10Import of XFree86 4.0.1Alan Hourihane
2000-06-13Merged bsd-1-0-1Doug Rabson
2000-05-30Merged bsd-1-0-0Doug Rabson
>void *data) { struct intel_i2c_chan *chan = data; struct drm_i915_private *dev_priv = chan->drm_dev->dev_private; u32 val; val = I915_READ(chan->reg); return ((val & GPIO_DATA_VAL_IN) != 0); } static void set_clock(void *data, int state_high) { struct intel_i2c_chan *chan = data; struct drm_device *dev = chan->drm_dev; struct drm_i915_private *dev_priv = chan->drm_dev->dev_private; u32 reserved = 0, clock_bits; /* On most chips, these bits must be preserved in software. */ if (!IS_I830(dev) && !IS_845G(dev)) reserved = I915_READ(chan->reg) & (GPIO_DATA_PULLUP_DISABLE | GPIO_CLOCK_PULLUP_DISABLE); if (state_high) clock_bits = GPIO_CLOCK_DIR_IN | GPIO_CLOCK_DIR_MASK; else clock_bits = GPIO_CLOCK_DIR_OUT | GPIO_CLOCK_DIR_MASK | GPIO_CLOCK_VAL_MASK; I915_WRITE(chan->reg, reserved | clock_bits); udelay(I2C_RISEFALL_TIME); /* wait for the line to change state */ } static void set_data(void *data, int state_high) { struct intel_i2c_chan *chan = data; struct drm_device *dev = chan->drm_dev; struct drm_i915_private *dev_priv = chan->drm_dev->dev_private; u32 reserved = 0, data_bits; /* On most chips, these bits must be preserved in software. */ if (!IS_I830(dev) && !IS_845G(dev)) reserved = I915_READ(chan->reg) & (GPIO_DATA_PULLUP_DISABLE | GPIO_CLOCK_PULLUP_DISABLE); if (state_high) data_bits = GPIO_DATA_DIR_IN | GPIO_DATA_DIR_MASK; else data_bits = GPIO_DATA_DIR_OUT | GPIO_DATA_DIR_MASK | GPIO_DATA_VAL_MASK; I915_WRITE(chan->reg, reserved | data_bits); udelay(I2C_RISEFALL_TIME); /* wait for the line to change state */ } /** * intel_i2c_create - instantiate an Intel i2c bus using the specified GPIO reg * @dev: DRM device * @output: driver specific output device * @reg: GPIO reg to use * @name: name for this bus * * Creates and registers a new i2c bus with the Linux i2c layer, for use * in output probing and control (e.g. DDC or SDVO control functions). * * Possible values for @reg include: * %GPIOA * %GPIOB * %GPIOC * %GPIOD * %GPIOE * %GPIOF * %GPIOG * %GPIOH * see PRM for details on how these different busses are used. */ struct intel_i2c_chan *intel_i2c_create(struct drm_device *dev, const u32 reg, const char *name) { struct intel_i2c_chan *chan; chan = kzalloc(sizeof(struct intel_i2c_chan), GFP_KERNEL); if (!chan) goto out_free; chan->drm_dev = dev; chan->reg = reg; snprintf(chan->adapter.name, I2C_NAME_SIZE, "intel drm %s", name); chan->adapter.owner = THIS_MODULE; #ifndef I2C_HW_B_INTELFB #define I2C_HW_B_INTELFB I2C_HW_B_I810 #endif chan->adapter.id = I2C_HW_B_INTELFB; chan->adapter.algo_data = &chan->algo; chan->adapter.dev.parent = &dev->pdev->dev; chan->algo.setsda = set_data; chan->algo.setscl = set_clock; chan->algo.getsda = get_data; chan->algo.getscl = get_clock; chan->algo.udelay = 20; chan->algo.timeout = usecs_to_jiffies(2200); chan->algo.data = chan; i2c_set_adapdata(&chan->adapter, chan); if(i2c_bit_add_bus(&chan->adapter)) goto out_free; /* JJJ: raise SCL and SDA? */ set_data(chan, 1); set_clock(chan, 1); udelay(20); return chan; out_free: kfree(chan); return NULL; } /** * intel_i2c_destroy - unregister and free i2c bus resources * @output: channel to free * * Unregister the adapter from the i2c layer, then free the structure. */ void intel_i2c_destroy(struct intel_i2c_chan *chan) { if (!chan) return; i2c_del_adapter(&chan->adapter); kfree(chan); }