Re: [PATCH] drm/radeon/kms: R3XX/R4XX AGP asic use PCI GART not PCIE GART
On Thu, 10 Sep 2009 13:47:09 +0200 Jerome Glisse jgli...@redhat.com wrote: R3XX/R4XX AGP asic use the old PCI GART block, not the new PCIE GART. Make sure we pick the right GART when disabling AGP. This patch doesn't apply to 2.6.31. It's not completely trivial to fix either - these declarations + void r100_pci_gart_tlb_flush(struct radeon_device *rdev); + int r100_pci_gart_enable(struct radeon_device *rdev); + void r100_pci_gart_disable(struct radeon_device *rdev); + int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); would naturally lie in radeon_asic.h but we can't do that because some stupidhead went and put this: static struct radeon_asic r100_asic = { into a .h file, making that header file unusable for the things which header files are used for. So please have another go. If you believe that the the patch is suitable for backporting into 2.6.31.x then please - cc sta...@kernel.org on the patch - add a `Cc: sta...@kernel.org' to the changelog - ensure that the changelog text explains to the -stable maintainers why this patch should be backported. Thanks. -- Come build with us! The BlackBerryreg; Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9#45;12, 2009. Register now#33; http://p.sf.net/sfu/devconf -- ___ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel
[PATCH] drm/radeon/kms: R3XX/R4XX AGP asic use PCI GART not PCIE GART
R3XX/R4XX AGP asic use the old PCI GART block, not the new PCIE GART. Make sure we pick the right GART when disabling AGP. Signed-off-by: Jerome Glisse jgli...@redhat.com --- drivers/gpu/drm/radeon/r300.c |6 ++ drivers/gpu/drm/radeon/r420.c |9 +++-- drivers/gpu/drm/radeon/radeon.h|4 drivers/gpu/drm/radeon/radeon_device.c |2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index a5f82f7..9c17b78 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c @@ -181,6 +181,12 @@ int r300_gart_enable(struct radeon_device *rdev) rdev-asic-gart_set_page = rv370_pcie_gart_set_page; return rv370_pcie_gart_enable(rdev); } + if (rdev-flags RADEON_IS_PCI) { + rdev-asic-gart_disable = r100_pci_gart_disable; + rdev-asic-gart_tlb_flush = r100_pci_gart_tlb_flush; + rdev-asic-gart_set_page = r100_pci_gart_set_page; + return r100_pci_gart_enable(rdev); + } return r100_pci_gart_enable(rdev); } diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 96303f0..551d699 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c @@ -101,8 +101,13 @@ int r420_mc_init(struct radeon_device *rdev) void r420_mc_fini(struct radeon_device *rdev) { - rv370_pcie_gart_disable(rdev); - radeon_gart_table_vram_free(rdev); + if (rdev-flags RADEON_IS_PCIE) { + rv370_pcie_gart_disable(rdev); + radeon_gart_table_vram_free(rdev); + } else { + r100_pci_gart_disable(rdev); + radeon_gart_table_ram_free(rdev); + } radeon_gart_fini(rdev); } diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index fa84c77..d6ff4e0 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -935,6 +935,10 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v) /* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */ void r100_cp_disable(struct radeon_device *rdev); +void r100_pci_gart_tlb_flush(struct radeon_device *rdev); +int r100_pci_gart_enable(struct radeon_device *rdev); +void r100_pci_gart_disable(struct radeon_device *rdev); +int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); /* r420,r423,rv410 */ u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg); diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 05e1af0..bf69394 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -503,7 +503,7 @@ int radeon_device_init(struct radeon_device *rdev, if (radeon_agpmode == -1) { rdev-flags = ~RADEON_IS_AGP; - if (rdev-family CHIP_RV515 || + if (rdev-family = CHIP_RV515 || rdev-family == CHIP_RV380 || rdev-family == CHIP_RV410 || rdev-family == CHIP_R423) { -- 1.6.4.2 -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july -- ___ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel
Re: [PATCH] drm/radeon/kms: R3XX/R4XX AGP asic use PCI GART not PCIE GART
On Thu, Sep 10, 2009 at 7:47 AM, Jerome Glissejgli...@redhat.com wrote: R3XX/R4XX AGP asic use the old PCI GART block, not the new PCIE GART. Make sure we pick the right GART when disabling AGP. Signed-off-by: Jerome Glisse jgli...@redhat.com Acked-by: Alex Deucher alexdeuc...@gmail.com --- drivers/gpu/drm/radeon/r300.c | 6 ++ drivers/gpu/drm/radeon/r420.c | 9 +++-- drivers/gpu/drm/radeon/radeon.h | 4 drivers/gpu/drm/radeon/radeon_device.c | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index a5f82f7..9c17b78 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c @@ -181,6 +181,12 @@ int r300_gart_enable(struct radeon_device *rdev) rdev-asic-gart_set_page = rv370_pcie_gart_set_page; return rv370_pcie_gart_enable(rdev); } + if (rdev-flags RADEON_IS_PCI) { + rdev-asic-gart_disable = r100_pci_gart_disable; + rdev-asic-gart_tlb_flush = r100_pci_gart_tlb_flush; + rdev-asic-gart_set_page = r100_pci_gart_set_page; + return r100_pci_gart_enable(rdev); + } return r100_pci_gart_enable(rdev); } diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 96303f0..551d699 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c @@ -101,8 +101,13 @@ int r420_mc_init(struct radeon_device *rdev) void r420_mc_fini(struct radeon_device *rdev) { - rv370_pcie_gart_disable(rdev); - radeon_gart_table_vram_free(rdev); + if (rdev-flags RADEON_IS_PCIE) { + rv370_pcie_gart_disable(rdev); + radeon_gart_table_vram_free(rdev); + } else { + r100_pci_gart_disable(rdev); + radeon_gart_table_ram_free(rdev); + } radeon_gart_fini(rdev); } diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index fa84c77..d6ff4e0 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -935,6 +935,10 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v) /* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */ void r100_cp_disable(struct radeon_device *rdev); +void r100_pci_gart_tlb_flush(struct radeon_device *rdev); +int r100_pci_gart_enable(struct radeon_device *rdev); +void r100_pci_gart_disable(struct radeon_device *rdev); +int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); /* r420,r423,rv410 */ u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg); diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 05e1af0..bf69394 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -503,7 +503,7 @@ int radeon_device_init(struct radeon_device *rdev, if (radeon_agpmode == -1) { rdev-flags = ~RADEON_IS_AGP; - if (rdev-family CHIP_RV515 || + if (rdev-family = CHIP_RV515 || rdev-family == CHIP_RV380 || rdev-family == CHIP_RV410 || rdev-family == CHIP_R423) { -- 1.6.4.2 -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july -- ___ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july -- ___ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel
[PATCH] drm/radeon/kms: R3XX/R4XX AGP asic use PCI GART not PCIE GART
R3XX/R4XX AGP asic use the old PCI GART block, not the new PCIE GART. Make sure we pick the right GART when disabling AGP. Signed-off-by: Jerome Glisse jgli...@redhat.com --- drivers/gpu/drm/radeon/r300.c |6 ++ drivers/gpu/drm/radeon/r420.c |9 +++-- drivers/gpu/drm/radeon/radeon.h|4 drivers/gpu/drm/radeon/radeon_device.c |5 + 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index a5f82f7..9c17b78 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c @@ -181,6 +181,12 @@ int r300_gart_enable(struct radeon_device *rdev) rdev-asic-gart_set_page = rv370_pcie_gart_set_page; return rv370_pcie_gart_enable(rdev); } + if (rdev-flags RADEON_IS_PCI) { + rdev-asic-gart_disable = r100_pci_gart_disable; + rdev-asic-gart_tlb_flush = r100_pci_gart_tlb_flush; + rdev-asic-gart_set_page = r100_pci_gart_set_page; + return r100_pci_gart_enable(rdev); + } return r100_pci_gart_enable(rdev); } diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 97426a6..029cee2 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c @@ -100,8 +100,13 @@ int r420_mc_init(struct radeon_device *rdev) void r420_mc_fini(struct radeon_device *rdev) { - rv370_pcie_gart_disable(rdev); - radeon_gart_table_vram_free(rdev); + if (rdev-flags RADEON_IS_PCIE) { + rv370_pcie_gart_disable(rdev); + radeon_gart_table_vram_free(rdev); + } else { + r100_pci_gart_disable(rdev); + radeon_gart_table_ram_free(rdev); + } radeon_gart_fini(rdev); } diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 24574bc..fe86b20 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -935,5 +935,9 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v) /* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */ void r100_cp_disable(struct radeon_device *rdev); +void r100_pci_gart_disable(struct radeon_device *rdev); +int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); +int r100_pci_gart_enable(struct radeon_device *rdev); +void r100_pci_gart_tlb_flush(struct radeon_device *rdev); #endif diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index f2469c5..da8646a 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -499,10 +499,7 @@ int radeon_device_init(struct radeon_device *rdev, if (radeon_agpmode == -1) { rdev-flags = ~RADEON_IS_AGP; - if (rdev-family CHIP_RV515 || - rdev-family == CHIP_RV380 || - rdev-family == CHIP_RV410 || - rdev-family == CHIP_R423) { + if (rdev-family = CHIP_RV515) { DRM_INFO(Forcing AGP to PCIE mode\n); rdev-flags |= RADEON_IS_PCIE; } else { -- 1.6.4.1 -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july -- ___ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel
Re: [PATCH] drm/radeon/kms: R3XX/R4XX AGP asic use PCI GART not PCIE GART
On Wed, Sep 9, 2009 at 4:24 PM, Jerome Glissejgli...@redhat.com wrote: R3XX/R4XX AGP asic use the old PCI GART block, not the new PCIE GART. Make sure we pick the right GART when disabling AGP. Just to clarify which gart block is on what r3xx/r4xx asic; If the card is chip family CHIP_R300, CHIP_R350, CHIP_RV350, or CHIP_R420, it uses the AIC PCI gart. If the chip family is CHIP_RV380, CHIP_R423, or CHIP_RV410, then it uses PCIE gart. Alex Signed-off-by: Jerome Glisse jgli...@redhat.com --- drivers/gpu/drm/radeon/r300.c | 6 ++ drivers/gpu/drm/radeon/r420.c | 9 +++-- drivers/gpu/drm/radeon/radeon.h | 4 drivers/gpu/drm/radeon/radeon_device.c | 5 + 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index a5f82f7..9c17b78 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c @@ -181,6 +181,12 @@ int r300_gart_enable(struct radeon_device *rdev) rdev-asic-gart_set_page = rv370_pcie_gart_set_page; return rv370_pcie_gart_enable(rdev); } + if (rdev-flags RADEON_IS_PCI) { + rdev-asic-gart_disable = r100_pci_gart_disable; + rdev-asic-gart_tlb_flush = r100_pci_gart_tlb_flush; + rdev-asic-gart_set_page = r100_pci_gart_set_page; + return r100_pci_gart_enable(rdev); + } return r100_pci_gart_enable(rdev); } diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 97426a6..029cee2 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c @@ -100,8 +100,13 @@ int r420_mc_init(struct radeon_device *rdev) void r420_mc_fini(struct radeon_device *rdev) { - rv370_pcie_gart_disable(rdev); - radeon_gart_table_vram_free(rdev); + if (rdev-flags RADEON_IS_PCIE) { + rv370_pcie_gart_disable(rdev); + radeon_gart_table_vram_free(rdev); + } else { + r100_pci_gart_disable(rdev); + radeon_gart_table_ram_free(rdev); + } radeon_gart_fini(rdev); } diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 24574bc..fe86b20 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h @@ -935,5 +935,9 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v) /* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */ void r100_cp_disable(struct radeon_device *rdev); +void r100_pci_gart_disable(struct radeon_device *rdev); +int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); +int r100_pci_gart_enable(struct radeon_device *rdev); +void r100_pci_gart_tlb_flush(struct radeon_device *rdev); #endif diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index f2469c5..da8646a 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -499,10 +499,7 @@ int radeon_device_init(struct radeon_device *rdev, if (radeon_agpmode == -1) { rdev-flags = ~RADEON_IS_AGP; - if (rdev-family CHIP_RV515 || - rdev-family == CHIP_RV380 || - rdev-family == CHIP_RV410 || - rdev-family == CHIP_R423) { + if (rdev-family = CHIP_RV515) { DRM_INFO(Forcing AGP to PCIE mode\n); rdev-flags |= RADEON_IS_PCIE; } else { -- 1.6.4.1 -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july -- ___ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july -- ___ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel