diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-02-09 12:33:45 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2014-02-09 12:33:45 +0000 |
commit | 2fdcbb5b23e0d78721760e4b1052be8b4ed61fca (patch) | |
tree | f37615ba7f515440b9f5934a5e0c59b475658fdd /sys/dev/pci | |
parent | 523a3c38d9ecc35f2b316c4fc7048d966a5ca14f (diff) |
radeon: Fix system hang issue when using KMS with older cards
From Adis Hamzadis
c9b986fd9f606cd00492c3c9e95926c654f4e04f in ubuntu 3.8
e49f3959a96dc279860af7e86e6dbcfda50580a5 in mainline linux
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/drm/radeon/evergreen.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/ni.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/r100.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/r300.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/r420.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/r520.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/r600.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/rs400.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/rs600.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/rs690.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/rv515.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/rv770.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon/si.c | 12 |
13 files changed, 91 insertions, 58 deletions
diff --git a/sys/dev/pci/drm/radeon/evergreen.c b/sys/dev/pci/drm/radeon/evergreen.c index 53aafe546fe..4142dd09342 100644 --- a/sys/dev/pci/drm/radeon/evergreen.c +++ b/sys/dev/pci/drm/radeon/evergreen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evergreen.c,v 1.10 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: evergreen.c,v 1.11 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2010 Advanced Micro Devices, Inc. * @@ -3602,6 +3602,12 @@ static int evergreen_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + r = r600_irq_init(rdev); if (r) { DRM_ERROR("radeon: IH init failed (%d).\n", r); @@ -3751,10 +3757,6 @@ int evergreen_init(struct radeon_device *rdev) if (r) return r; - r = radeon_irq_kms_init(rdev); - if (r) - return r; - rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ring_obj = NULL; r600_ring_init(rdev, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX], 1024 * 1024); diff --git a/sys/dev/pci/drm/radeon/ni.c b/sys/dev/pci/drm/radeon/ni.c index 12322df7472..03f035015df 100644 --- a/sys/dev/pci/drm/radeon/ni.c +++ b/sys/dev/pci/drm/radeon/ni.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ni.c,v 1.4 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: ni.c,v 1.5 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2010 Advanced Micro Devices, Inc. * @@ -1614,6 +1614,12 @@ static int cayman_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + r = r600_irq_init(rdev); if (r) { DRM_ERROR("radeon: IH init failed (%d).\n", r); @@ -1760,10 +1766,6 @@ int cayman_init(struct radeon_device *rdev) if (r) return r; - r = radeon_irq_kms_init(rdev); - if (r) - return r; - ring->ring_obj = NULL; r600_ring_init(rdev, ring, 1024 * 1024); diff --git a/sys/dev/pci/drm/radeon/r100.c b/sys/dev/pci/drm/radeon/r100.c index 6c9c2f9e1dc..8960dfa3a26 100644 --- a/sys/dev/pci/drm/radeon/r100.c +++ b/sys/dev/pci/drm/radeon/r100.c @@ -1,4 +1,4 @@ -/* $OpenBSD: r100.c,v 1.4 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: r100.c,v 1.5 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -3999,6 +3999,12 @@ static int r100_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + r100_irq_set(rdev); rdev->config.r100.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); /* 1M ring buffer */ @@ -4154,9 +4160,6 @@ int r100_init(struct radeon_device *rdev) r = radeon_fence_driver_init(rdev); if (r) return r; - r = radeon_irq_kms_init(rdev); - if (r) - return r; /* Memory manager */ r = radeon_bo_init(rdev); if (r) diff --git a/sys/dev/pci/drm/radeon/r300.c b/sys/dev/pci/drm/radeon/r300.c index 3b033458f91..2d11f48c104 100644 --- a/sys/dev/pci/drm/radeon/r300.c +++ b/sys/dev/pci/drm/radeon/r300.c @@ -1,4 +1,4 @@ -/* $OpenBSD: r300.c,v 1.2 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: r300.c,v 1.3 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -1389,6 +1389,12 @@ static int r300_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + r100_irq_set(rdev); rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); /* 1M ring buffer */ @@ -1523,9 +1529,6 @@ int r300_init(struct radeon_device *rdev) r = radeon_fence_driver_init(rdev); if (r) return r; - r = radeon_irq_kms_init(rdev); - if (r) - return r; /* Memory manager */ r = radeon_bo_init(rdev); if (r) diff --git a/sys/dev/pci/drm/radeon/r420.c b/sys/dev/pci/drm/radeon/r420.c index 5c03dad5b87..ddcdd9d49e3 100644 --- a/sys/dev/pci/drm/radeon/r420.c +++ b/sys/dev/pci/drm/radeon/r420.c @@ -1,4 +1,4 @@ -/* $OpenBSD: r420.c,v 1.2 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: r420.c,v 1.3 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -266,6 +266,12 @@ static int r420_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + r100_irq_set(rdev); rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); /* 1M ring buffer */ @@ -412,10 +418,6 @@ int r420_init(struct radeon_device *rdev) if (r) { return r; } - r = radeon_irq_kms_init(rdev); - if (r) { - return r; - } /* Memory manager */ r = radeon_bo_init(rdev); if (r) { diff --git a/sys/dev/pci/drm/radeon/r520.c b/sys/dev/pci/drm/radeon/r520.c index bead98c4090..ee15d76c4dc 100644 --- a/sys/dev/pci/drm/radeon/r520.c +++ b/sys/dev/pci/drm/radeon/r520.c @@ -1,4 +1,4 @@ -/* $OpenBSD: r520.c,v 1.1 2013/08/12 04:11:53 jsg Exp $ */ +/* $OpenBSD: r520.c,v 1.2 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -195,6 +195,12 @@ static int r520_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + rs600_irq_set(rdev); rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); /* 1M ring buffer */ @@ -298,9 +304,6 @@ int r520_init(struct radeon_device *rdev) r = radeon_fence_driver_init(rdev); if (r) return r; - r = radeon_irq_kms_init(rdev); - if (r) - return r; /* Memory manager */ r = radeon_bo_init(rdev); if (r) diff --git a/sys/dev/pci/drm/radeon/r600.c b/sys/dev/pci/drm/radeon/r600.c index d17d4867341..64902e8c1cc 100644 --- a/sys/dev/pci/drm/radeon/r600.c +++ b/sys/dev/pci/drm/radeon/r600.c @@ -1,4 +1,4 @@ -/* $OpenBSD: r600.c,v 1.7 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: r600.c,v 1.8 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -2814,6 +2814,12 @@ static int r600_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + r = r600_irq_init(rdev); if (r) { DRM_ERROR("radeon: IH init failed (%d).\n", r); @@ -2968,10 +2974,6 @@ int r600_init(struct radeon_device *rdev) if (r) return r; - r = radeon_irq_kms_init(rdev); - if (r) - return r; - rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ring_obj = NULL; r600_ring_init(rdev, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX], 1024 * 1024); diff --git a/sys/dev/pci/drm/radeon/rs400.c b/sys/dev/pci/drm/radeon/rs400.c index 008d8fbc49e..4c132a950a2 100644 --- a/sys/dev/pci/drm/radeon/rs400.c +++ b/sys/dev/pci/drm/radeon/rs400.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rs400.c,v 1.3 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: rs400.c,v 1.4 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -419,6 +419,12 @@ static int rs400_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + r100_irq_set(rdev); rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); /* 1M ring buffer */ @@ -537,9 +543,6 @@ int rs400_init(struct radeon_device *rdev) r = radeon_fence_driver_init(rdev); if (r) return r; - r = radeon_irq_kms_init(rdev); - if (r) - return r; /* Memory manager */ r = radeon_bo_init(rdev); if (r) diff --git a/sys/dev/pci/drm/radeon/rs600.c b/sys/dev/pci/drm/radeon/rs600.c index c5855e081e5..de23e52be2f 100644 --- a/sys/dev/pci/drm/radeon/rs600.c +++ b/sys/dev/pci/drm/radeon/rs600.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rs600.c,v 1.5 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: rs600.c,v 1.6 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -929,6 +929,12 @@ static int rs600_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + rs600_irq_set(rdev); rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); /* 1M ring buffer */ @@ -1053,9 +1059,6 @@ int rs600_init(struct radeon_device *rdev) r = radeon_fence_driver_init(rdev); if (r) return r; - r = radeon_irq_kms_init(rdev); - if (r) - return r; /* Memory manager */ r = radeon_bo_init(rdev); if (r) diff --git a/sys/dev/pci/drm/radeon/rs690.c b/sys/dev/pci/drm/radeon/rs690.c index 75f7e98d4d5..f20785dfeed 100644 --- a/sys/dev/pci/drm/radeon/rs690.c +++ b/sys/dev/pci/drm/radeon/rs690.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rs690.c,v 1.3 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: rs690.c,v 1.4 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -640,6 +640,12 @@ static int rs690_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + rs600_irq_set(rdev); rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); /* 1M ring buffer */ @@ -765,9 +771,6 @@ int rs690_init(struct radeon_device *rdev) r = radeon_fence_driver_init(rdev); if (r) return r; - r = radeon_irq_kms_init(rdev); - if (r) - return r; /* Memory manager */ r = radeon_bo_init(rdev); if (r) diff --git a/sys/dev/pci/drm/radeon/rv515.c b/sys/dev/pci/drm/radeon/rv515.c index c293394625e..0a2656e90f5 100644 --- a/sys/dev/pci/drm/radeon/rv515.c +++ b/sys/dev/pci/drm/radeon/rv515.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rv515.c,v 1.2 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: rv515.c,v 1.3 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -531,6 +531,12 @@ static int rv515_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + rs600_irq_set(rdev); rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); /* 1M ring buffer */ @@ -661,9 +667,6 @@ int rv515_init(struct radeon_device *rdev) r = radeon_fence_driver_init(rdev); if (r) return r; - r = radeon_irq_kms_init(rdev); - if (r) - return r; /* Memory manager */ r = radeon_bo_init(rdev); if (r) diff --git a/sys/dev/pci/drm/radeon/rv770.c b/sys/dev/pci/drm/radeon/rv770.c index 9925874d72f..e8b20a14551 100644 --- a/sys/dev/pci/drm/radeon/rv770.c +++ b/sys/dev/pci/drm/radeon/rv770.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rv770.c,v 1.4 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: rv770.c,v 1.5 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2008 Advanced Micro Devices, Inc. * Copyright 2008 Red Hat Inc. @@ -1015,6 +1015,12 @@ static int rv770_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + r = r600_irq_init(rdev); if (r) { DRM_ERROR("radeon: IH init failed (%d).\n", r); @@ -1154,10 +1160,6 @@ int rv770_init(struct radeon_device *rdev) if (r) return r; - r = radeon_irq_kms_init(rdev); - if (r) - return r; - rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ring_obj = NULL; r600_ring_init(rdev, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX], 1024 * 1024); diff --git a/sys/dev/pci/drm/radeon/si.c b/sys/dev/pci/drm/radeon/si.c index 0c289122315..2f9aad5cfb3 100644 --- a/sys/dev/pci/drm/radeon/si.c +++ b/sys/dev/pci/drm/radeon/si.c @@ -1,4 +1,4 @@ -/* $OpenBSD: si.c,v 1.9 2014/02/09 11:03:31 jsg Exp $ */ +/* $OpenBSD: si.c,v 1.10 2014/02/09 12:33:44 jsg Exp $ */ /* * Copyright 2011 Advanced Micro Devices, Inc. * @@ -4170,6 +4170,12 @@ static int si_startup(struct radeon_device *rdev) } /* Enable IRQ */ + if (!rdev->irq.installed) { + r = radeon_irq_kms_init(rdev); + if (r) + return r; + } + r = si_irq_init(rdev); if (r) { DRM_ERROR("radeon: IH init failed (%d).\n", r); @@ -4330,10 +4336,6 @@ int si_init(struct radeon_device *rdev) if (r) return r; - r = radeon_irq_kms_init(rdev); - if (r) - return r; - ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]; ring->ring_obj = NULL; r600_ring_init(rdev, ring, 1024 * 1024); |