r300.c (30eb77f4e6ba20f797af4ff79807fae7cb67429e) | r300.c (b15ba51207e54245409d6f46e20dab36f906eed1) |
---|---|
1/* 2 * Copyright 2008 Advanced Micro Devices, Inc. 3 * Copyright 2008 Red Hat Inc. 4 * Copyright 2009 Jerome Glisse. 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a 7 * copy of this software and associated documentation files (the "Software"), 8 * to deal in the Software without restriction, including without limitation --- 1400 unchanged lines hidden (view full) --- 1409 r100_irq_set(rdev); 1410 rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); 1411 /* 1M ring buffer */ 1412 r = r100_cp_init(rdev, 1024 * 1024); 1413 if (r) { 1414 dev_err(rdev->dev, "failed initializing CP (%d).\n", r); 1415 return r; 1416 } | 1/* 2 * Copyright 2008 Advanced Micro Devices, Inc. 3 * Copyright 2008 Red Hat Inc. 4 * Copyright 2009 Jerome Glisse. 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a 7 * copy of this software and associated documentation files (the "Software"), 8 * to deal in the Software without restriction, including without limitation --- 1400 unchanged lines hidden (view full) --- 1409 r100_irq_set(rdev); 1410 rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); 1411 /* 1M ring buffer */ 1412 r = r100_cp_init(rdev, 1024 * 1024); 1413 if (r) { 1414 dev_err(rdev->dev, "failed initializing CP (%d).\n", r); 1415 return r; 1416 } |
1417 r = r100_ib_init(rdev); | 1417 1418 r = radeon_ib_pool_start(rdev); 1419 if (r) 1420 return r; 1421 1422 r = r100_ib_test(rdev); |
1418 if (r) { | 1423 if (r) { |
1419 dev_err(rdev->dev, "failed initializing IB (%d).\n", r); | 1424 dev_err(rdev->dev, "failed testing IB (%d).\n", r); 1425 rdev->accel_working = false; |
1420 return r; 1421 } | 1426 return r; 1427 } |
1428 |
|
1422 return 0; 1423} 1424 1425int r300_resume(struct radeon_device *rdev) 1426{ 1427 /* Make sur GART are not working */ 1428 if (rdev->flags & RADEON_IS_PCIE) 1429 rv370_pcie_gart_disable(rdev); --- 8 unchanged lines hidden (view full) --- 1438 RREG32(R_0007C0_CP_STAT)); 1439 } 1440 /* post */ 1441 radeon_combios_asic_init(rdev->ddev); 1442 /* Resume clock after posting */ 1443 r300_clock_startup(rdev); 1444 /* Initialize surface registers */ 1445 radeon_surface_init(rdev); | 1429 return 0; 1430} 1431 1432int r300_resume(struct radeon_device *rdev) 1433{ 1434 /* Make sur GART are not working */ 1435 if (rdev->flags & RADEON_IS_PCIE) 1436 rv370_pcie_gart_disable(rdev); --- 8 unchanged lines hidden (view full) --- 1445 RREG32(R_0007C0_CP_STAT)); 1446 } 1447 /* post */ 1448 radeon_combios_asic_init(rdev->ddev); 1449 /* Resume clock after posting */ 1450 r300_clock_startup(rdev); 1451 /* Initialize surface registers */ 1452 radeon_surface_init(rdev); |
1453 1454 rdev->accel_working = true; |
|
1446 return r300_startup(rdev); 1447} 1448 1449int r300_suspend(struct radeon_device *rdev) 1450{ | 1455 return r300_startup(rdev); 1456} 1457 1458int r300_suspend(struct radeon_device *rdev) 1459{ |
1460 radeon_ib_pool_suspend(rdev); |
|
1451 r100_cp_disable(rdev); 1452 radeon_wb_disable(rdev); 1453 r100_irq_disable(rdev); 1454 if (rdev->flags & RADEON_IS_PCIE) 1455 rv370_pcie_gart_disable(rdev); 1456 if (rdev->flags & RADEON_IS_PCI) 1457 r100_pci_gart_disable(rdev); 1458 return 0; --- 84 unchanged lines hidden (view full) --- 1543 return r; 1544 } 1545 if (rdev->flags & RADEON_IS_PCI) { 1546 r = r100_pci_gart_init(rdev); 1547 if (r) 1548 return r; 1549 } 1550 r300_set_reg_safe(rdev); | 1461 r100_cp_disable(rdev); 1462 radeon_wb_disable(rdev); 1463 r100_irq_disable(rdev); 1464 if (rdev->flags & RADEON_IS_PCIE) 1465 rv370_pcie_gart_disable(rdev); 1466 if (rdev->flags & RADEON_IS_PCI) 1467 r100_pci_gart_disable(rdev); 1468 return 0; --- 84 unchanged lines hidden (view full) --- 1553 return r; 1554 } 1555 if (rdev->flags & RADEON_IS_PCI) { 1556 r = r100_pci_gart_init(rdev); 1557 if (r) 1558 return r; 1559 } 1560 r300_set_reg_safe(rdev); |
1561 1562 r = radeon_ib_pool_init(rdev); |
|
1551 rdev->accel_working = true; | 1563 rdev->accel_working = true; |
1564 if (r) { 1565 dev_err(rdev->dev, "IB initialization failed (%d).\n", r); 1566 rdev->accel_working = false; 1567 } 1568 |
|
1552 r = r300_startup(rdev); 1553 if (r) { 1554 /* Somethings want wront with the accel init stop accel */ 1555 dev_err(rdev->dev, "Disabling GPU acceleration\n"); 1556 r100_cp_fini(rdev); 1557 radeon_wb_fini(rdev); 1558 r100_ib_fini(rdev); 1559 radeon_irq_kms_fini(rdev); 1560 if (rdev->flags & RADEON_IS_PCIE) 1561 rv370_pcie_gart_fini(rdev); 1562 if (rdev->flags & RADEON_IS_PCI) 1563 r100_pci_gart_fini(rdev); 1564 radeon_agp_fini(rdev); 1565 rdev->accel_working = false; 1566 } 1567 return 0; 1568} | 1569 r = r300_startup(rdev); 1570 if (r) { 1571 /* Somethings want wront with the accel init stop accel */ 1572 dev_err(rdev->dev, "Disabling GPU acceleration\n"); 1573 r100_cp_fini(rdev); 1574 radeon_wb_fini(rdev); 1575 r100_ib_fini(rdev); 1576 radeon_irq_kms_fini(rdev); 1577 if (rdev->flags & RADEON_IS_PCIE) 1578 rv370_pcie_gart_fini(rdev); 1579 if (rdev->flags & RADEON_IS_PCI) 1580 r100_pci_gart_fini(rdev); 1581 radeon_agp_fini(rdev); 1582 rdev->accel_working = false; 1583 } 1584 return 0; 1585} |