summaryrefslogtreecommitdiff
path: root/shared-core/radeon_irq.c
AgeCommit message (Collapse)Author
2005-11-28Assert an MIT copyright on sis_drm.h, since one was lacking and I createdEric Anholt
that particular file. Its contents have changed a good bit since the original sis code, and the original sis code didn't care much about attribution since it routinely disclaims Precision Insight/VA Linux from responsibility. Also, adjust formatting around license headers (have a comment open immediately before the "Copyright" line, not as a runon of any previous comments) for automatic processing into FreeBSD, where /*- is used to signal the beginning of license headers for automatic compilation of license lists.
2005-11-11fix up radeon whitespaceDave Airlie
2005-06-06fix some issues with radeon interrupt handlingDave Airlie
From: Dave Airlie + Benjamin Herrenschmidt
2005-02-01cleanup patch from Adrian Bunk <bunk@stusta.de>Dave Airlie
2004-09-30Lindent of core build. Drivers checked for no binary diffs. A few filesJon Smirl
weren't Lindent's because their comments didn't convert very well. A bunch of other minor clean up with no code implact included.
2004-09-27First check in for DRM that splits core from personality modulesJon Smirl
2004-08-24Merged drmfntbl-0-0-2Dave Airlie
2004-07-25sync up with current 2.6 kernel bk tree - mostly __user annotationsDave Airlie
2003-10-17- Move IRQ functions from drm_dma.h to new drm_irq.h and disentangle themEric Anholt
from __HAVE_DMA. This will be useful for adding vblank sync support to sis and tdfx. Rename dma_service to irq_handler, which is more accurately what it is. - Fix the #if _HAVE_DMA_IRQ in radeon, r128, mga, i810, i830, gamma to have the right number of underscores. This may have been a problem in the case that the server died without doing its DRM_IOCTL_CONTROL to uninit.
2003-07-29IRQ code cleanup suggested by Linus TorvaldsMichel Daenzer
i830 build fix
2003-07-25Compile fixes for recent 2.5/2.6 Linux kernels. I hope this doesn't breakMichel Daenzer
the i830 driver or the BSDs. :)
2003-04-26Ensure driver has been initialized (dev_private != NULL) before installingLeif Delgass
irq handler in DRM(irq_install). Modify all drivers to ensure irq handler is removed before cleanup and cleanup is called at takedown. Remove unused buffer private struct fields in i810, i830. Check for lock on init/cleanup in all drivers except i810/i830. The current DDX for i810 and i830 doesn't hold the lock on kernel init (FIXME?).
2003-03-28merged drm-filp-0-1-branchKeith Whitwell
2003-02-04only acknowledge interrupts we handle - others could be used outside theMichel Daenzer
DRM
2002-12-04further vertical blank interrupt cleanups: remove unused variable,Michel Daenzer
non-ambiguous variable names, don't express subtraction in unnecessarily complicated ways
2002-12-03vertical blank interrupt cleanups: use spinlock instead of semaphore, sendMichel Daenzer
signal directly from interrupt handler instead of using a taskqueue (based on feedback by Linus Torvalds)
2002-11-30vertical blank ioctl can send signal instead of blockingMichel Daenzer
2002-10-01fix wait condition for vertical blank IRQsMichel Daenzer
2002-09-29Move os-dependent stuff out of radeon_irq.cKeith Whitwell
2002-09-29Fix up BSD irq handling.Eric Anholt
2002-09-27make SW interrupts more robust: write sequence number to scratch register,Michel Daenzer
acknowledge any lost interrupts before waiting
2002-09-26DRM(vblank_wait) is driver specificMichel Daenzer
2002-09-25common ioctl to wait for vertical blank IRQsMichel Daenzer
2002-09-23merged r200-0-2-branch to trunkKeith Whitwell
ase CONNECTOR_VGA: case CONNECTOR_TV: analog_possible = true; break; case CONNECTOR_DVI_I: analog_possible = true; digital_possible = true; break; case CONNECTOR_DVI_D: case CONNECTOR_LVDS: digital_possible = true; break; default: break; } /* Return early on bad situations. */ if (!analog_possible && !digital_possible) return NULL; if (!analog_possible && !digital) return NULL; if (!digital_possible && digital) return NULL; list_for_each_entry(output, &display->outputs, item) { if (connector->bus != output->bus) continue; if (digital && output->type == OUTPUT_TMDS) return output; if (digital && output->type == OUTPUT_LVDS) return output; if (!digital && output->type == OUTPUT_DAC) return output; if (!digital && output->type == OUTPUT_TV) return output; } return NULL; } static int nv50_connector_hpd_detect(struct nv50_connector *connector) { struct drm_nouveau_private *dev_priv = connector->dev->dev_private; bool present = 0; uint32_t reg = 0; /* Assume connected for the moment. */ if (connector->type == CONNECTOR_LVDS) { NV50_DEBUG("LVDS is defaulting to connected for the moment.\n"); return 1; } /* No i2c port, no idea what to do for hotplug. */ if (connector->i2c_chan->index == 15) { DRM_ERROR("You have a non-LVDS SOR with no i2c port, please report\n"); return -EINVAL; } if (connector->i2c_chan->index > 3) { DRM_ERROR("You have an unusual configuration, index is %d\n", connector->i2c_chan->index); DRM_ERROR("Please report.\n"); return -EINVAL; } /* Check hotplug pins. */ reg = NV_READ(NV50_PCONNECTOR_HOTPLUG_STATE); if (reg & (NV50_PCONNECTOR_HOTPLUG_STATE_PIN_CONNECTED_I2C0 << (4 * connector->i2c_chan->index))) present = 1; if (present) NV50_DEBUG("Hotplug detect returned positive for bus %d\n", connector->bus); else NV50_DEBUG("Hotplug detect returned negative for bus %d\n", connector->bus); return present; } static int nv50_connector_i2c_detect(struct nv50_connector *connector) { /* kindly borrrowed from the intel driver, hope it works. */ uint8_t out_buf[] = { 0x0, 0x0}; uint8_t buf[2]; int ret; struct i2c_msg msgs[] = { { .addr = 0x50, .flags = 0, .len = 1, .buf = out_buf, }, { .addr = 0x50, .flags = I2C_M_RD, .len = 1, .buf = buf, } }; if (!connector->i2c_chan) return -EINVAL; ret = i2c_transfer(&connector->i2c_chan->adapter, msgs, 2); NV50_DEBUG("I2C detect returned %d\n", ret); if (ret == 2) return true; return false; } static int nv50_connector_destroy(struct nv50_connector *connector) { struct drm_device *dev = connector->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; struct nv50_display *display = nv50_get_display(dev); NV50_DEBUG("\n"); if (!display || !connector) return -EINVAL; list_del(&connector->item); if (connector->i2c_chan) nv50_i2c_channel_destroy(connector->i2c_chan); if (dev_priv->free_connector) dev_priv->free_connector(connector); return 0; } int nv50_connector_create(struct drm_device *dev, int bus, int i2c_index, int type) { struct nv50_connector *connector = NULL; struct drm_nouveau_private *dev_priv = dev->dev_private; struct nv50_display *display = NULL; NV50_DEBUG("\n"); /* This allows the public layer to do it's thing. */ if (dev_priv->alloc_connector) connector = dev_priv->alloc_connector(dev); if (!connector) return -ENOMEM; connector->dev = dev; display = nv50_get_display(dev); if (!display) goto out; if (type == CONNECTOR_UNKNOWN) goto out; list_add_tail(&connector->item, &display->connectors); connector->bus = bus; connector->type = type; switch (type) { case CONNECTOR_VGA: DRM_INFO("Detected a VGA connector\n"); break; case CONNECTOR_DVI_D: DRM_INFO("Detected a DVI-D connector\n"); break; case CONNECTOR_DVI_I: DRM_INFO("Detected a DVI-I connector\n"); break; case CONNECTOR_LVDS: DRM_INFO("Detected a LVDS connector\n"); break; case CONNECTOR_TV: DRM_INFO("Detected a TV connector\n"); break; default: DRM_ERROR("Unknown connector, this is not good.\n"); break; } /* some reasonable defaults */ if (type == CONNECTOR_DVI_D || type == CONNECTOR_DVI_I || type == CONNECTOR_LVDS) connector->requested_scaling_mode = SCALE_FULLSCREEN; else connector->requested_scaling_mode = SCALE_NON_GPU; connector->use_dithering = false; if (i2c_index < 0xf) connector->i2c_chan = nv50_i2c_channel_create(dev, i2c_index); /* set function pointers */ connector->hpd_detect = nv50_connector_hpd_detect; connector->i2c_detect = nv50_connector_i2c_detect; connector->destroy = nv50_connector_destroy; connector->to_output = nv50_connector_to_output; return 0; out: if (dev_priv->free_connector) dev_priv->free_connector(connector); return -EINVAL; }