34 #include <linux/slab.h>
57 dev->dev_private =
NULL;
83 dev->dev_private = (
void *)rdev;
86 if (drm_pci_device_is_agp(dev)) {
88 }
else if (pci_is_pcie(dev->pdev)) {
102 dev_err(&dev->pdev->dev,
"Fatal error during GPU init\n");
112 dev_err(&dev->pdev->dev,
"Fatal error during modeset init\n");
121 "Error during ACPI methods call\n");
141 struct drm_file **
owner,
142 struct drm_file *applier,
150 }
else if (*value == 0) {
152 if (*owner == applier)
155 *value = *owner == applier ? 1 : 0;
195 DRM_ERROR(
"copy_to_user %s:%u\n", __func__, __LINE__);
200 DRM_DEBUG_KMS(
"timestamp is r6xx+ only!\n");
207 DRM_ERROR(
"copy_from_user %s:%u\n", __func__, __LINE__);
213 value = dev->pci_device;
229 for (i = 0, found = 0; i < rdev->
num_crtc; i++) {
231 if (crtc && crtc->
base.id == value) {
239 DRM_DEBUG_KMS(
"unknown crtc id %d\n", value);
248 value = rdev->
config.
si.tile_config;
258 DRM_DEBUG_KMS(
"tiling config is r6xx+ only!\n");
270 DRM_DEBUG_KMS(
"WANT_HYPERZ: invalid value %d\n", value);
273 radeon_set_filp_rights(dev, &rdev->
hyperz_filp, filp, &value);
278 DRM_DEBUG_KMS(
"WANT_CMASK: invalid value %d\n", value);
281 radeon_set_filp_rights(dev, &rdev->
cmask_filp, filp, &value);
285 value = rdev->
clock.spll.reference_freq * 10;
289 value = rdev->
config.
si.max_backends_per_se *
306 value = rdev->
config.
si.max_tile_pipes;
324 value = rdev->
config.
si.backend_map;
351 value = rdev->
config.
si.max_cu_per_sh;
365 DRM_DEBUG_KMS(
"Invalid request %d\n", info->
request);
369 DRM_ERROR(
"copy_to_user %s:%u\n", __func__, __LINE__);
417 file_priv->driver_priv =
NULL;
445 file_priv->driver_priv = fpriv;
459 struct drm_file *file_priv)
480 file_priv->driver_priv =
NULL;
494 struct drm_file *file_priv)
520 DRM_ERROR(
"Invalid crtc %d\n", crtc);
539 unsigned long irqflags;
543 DRM_ERROR(
"Invalid crtc %d\n", crtc);
548 rdev->
irq.crtc_vblank_int[crtc] =
true;
550 spin_unlock_irqrestore(&rdev->
irq.lock, irqflags);
565 unsigned long irqflags;
568 DRM_ERROR(
"Invalid crtc %d\n", crtc);
573 rdev->
irq.crtc_vblank_int[crtc] =
false;
575 spin_unlock_irqrestore(&rdev->
irq.lock, irqflags);
600 DRM_ERROR(
"Invalid crtc %d\n", crtc);
605 drmcrtc = &rdev->
mode_info.crtcs[crtc]->base;
617 struct drm_file *file_priv)
623 #define KMS_INVALID_IOCTL(name) \
624 int name(struct drm_device *dev, void *data, struct drm_file *file_priv)\
626 DRM_ERROR("invalid ioctl with kms %s\n", __func__); \
663 DRM_IOCTL_DEF_DRV(RADEON_CP_INIT, radeon_cp_init_kms, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
664 DRM_IOCTL_DEF_DRV(RADEON_CP_START, radeon_cp_start_kms, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
665 DRM_IOCTL_DEF_DRV(RADEON_CP_STOP, radeon_cp_stop_kms, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
666 DRM_IOCTL_DEF_DRV(RADEON_CP_RESET, radeon_cp_reset_kms, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
667 DRM_IOCTL_DEF_DRV(RADEON_CP_IDLE, radeon_cp_idle_kms, DRM_AUTH),
668 DRM_IOCTL_DEF_DRV(RADEON_CP_RESUME, radeon_cp_resume_kms, DRM_AUTH),
669 DRM_IOCTL_DEF_DRV(RADEON_RESET, radeon_engine_reset_kms, DRM_AUTH),
670 DRM_IOCTL_DEF_DRV(RADEON_FULLSCREEN, radeon_fullscreen_kms, DRM_AUTH),
671 DRM_IOCTL_DEF_DRV(RADEON_SWAP, radeon_cp_swap_kms, DRM_AUTH),
672 DRM_IOCTL_DEF_DRV(RADEON_CLEAR, radeon_cp_clear_kms, DRM_AUTH),
673 DRM_IOCTL_DEF_DRV(RADEON_VERTEX, radeon_cp_vertex_kms, DRM_AUTH),
674 DRM_IOCTL_DEF_DRV(RADEON_INDICES, radeon_cp_indices_kms, DRM_AUTH),
675 DRM_IOCTL_DEF_DRV(RADEON_TEXTURE, radeon_cp_texture_kms, DRM_AUTH),
676 DRM_IOCTL_DEF_DRV(RADEON_STIPPLE, radeon_cp_stipple_kms, DRM_AUTH),
677 DRM_IOCTL_DEF_DRV(RADEON_INDIRECT, radeon_cp_indirect_kms, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
678 DRM_IOCTL_DEF_DRV(RADEON_VERTEX2, radeon_cp_vertex2_kms, DRM_AUTH),
679 DRM_IOCTL_DEF_DRV(RADEON_CMDBUF, radeon_cp_cmdbuf_kms, DRM_AUTH),
680 DRM_IOCTL_DEF_DRV(RADEON_GETPARAM, radeon_cp_getparam_kms, DRM_AUTH),
681 DRM_IOCTL_DEF_DRV(RADEON_FLIP, radeon_cp_flip_kms, DRM_AUTH),
682 DRM_IOCTL_DEF_DRV(RADEON_ALLOC, radeon_mem_alloc_kms, DRM_AUTH),
683 DRM_IOCTL_DEF_DRV(RADEON_FREE, radeon_mem_free_kms, DRM_AUTH),
684 DRM_IOCTL_DEF_DRV(RADEON_INIT_HEAP, radeon_mem_init_heap_kms, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY),
685 DRM_IOCTL_DEF_DRV(RADEON_IRQ_EMIT, radeon_irq_emit_kms, DRM_AUTH),
686 DRM_IOCTL_DEF_DRV(RADEON_IRQ_WAIT, radeon_irq_wait_kms, DRM_AUTH),
687 DRM_IOCTL_DEF_DRV(RADEON_SETPARAM, radeon_cp_setparam_kms, DRM_AUTH),
688 DRM_IOCTL_DEF_DRV(RADEON_SURF_ALLOC, radeon_surface_alloc_kms, DRM_AUTH),
689 DRM_IOCTL_DEF_DRV(RADEON_SURF_FREE, radeon_surface_free_kms, DRM_AUTH),