rs400.c (30eb77f4e6ba20f797af4ff79807fae7cb67429e) | rs400.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 --- 411 unchanged lines hidden (view full) --- 420 r100_irq_set(rdev); 421 rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); 422 /* 1M ring buffer */ 423 r = r100_cp_init(rdev, 1024 * 1024); 424 if (r) { 425 dev_err(rdev->dev, "failed initializing CP (%d).\n", r); 426 return r; 427 } | 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 --- 411 unchanged lines hidden (view full) --- 420 r100_irq_set(rdev); 421 rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); 422 /* 1M ring buffer */ 423 r = r100_cp_init(rdev, 1024 * 1024); 424 if (r) { 425 dev_err(rdev->dev, "failed initializing CP (%d).\n", r); 426 return r; 427 } |
428 r = r100_ib_init(rdev); | 428 429 r = radeon_ib_pool_start(rdev); 430 if (r) 431 return r; 432 433 r = r100_ib_test(rdev); |
429 if (r) { | 434 if (r) { |
430 dev_err(rdev->dev, "failed initializing IB (%d).\n", r); | 435 dev_err(rdev->dev, "failed testing IB (%d).\n", r); 436 rdev->accel_working = false; |
431 return r; 432 } | 437 return r; 438 } |
439 |
|
433 return 0; 434} 435 436int rs400_resume(struct radeon_device *rdev) 437{ 438 /* Make sur GART are not working */ 439 rs400_gart_disable(rdev); 440 /* Resume clock before doing reset */ --- 7 unchanged lines hidden (view full) --- 448 RREG32(R_0007C0_CP_STAT)); 449 } 450 /* post */ 451 radeon_combios_asic_init(rdev->ddev); 452 /* Resume clock after posting */ 453 r300_clock_startup(rdev); 454 /* Initialize surface registers */ 455 radeon_surface_init(rdev); | 440 return 0; 441} 442 443int rs400_resume(struct radeon_device *rdev) 444{ 445 /* Make sur GART are not working */ 446 rs400_gart_disable(rdev); 447 /* Resume clock before doing reset */ --- 7 unchanged lines hidden (view full) --- 455 RREG32(R_0007C0_CP_STAT)); 456 } 457 /* post */ 458 radeon_combios_asic_init(rdev->ddev); 459 /* Resume clock after posting */ 460 r300_clock_startup(rdev); 461 /* Initialize surface registers */ 462 radeon_surface_init(rdev); |
463 464 rdev->accel_working = true; |
|
456 return rs400_startup(rdev); 457} 458 459int rs400_suspend(struct radeon_device *rdev) 460{ | 465 return rs400_startup(rdev); 466} 467 468int rs400_suspend(struct radeon_device *rdev) 469{ |
470 radeon_ib_pool_suspend(rdev); |
|
461 r100_cp_disable(rdev); 462 radeon_wb_disable(rdev); 463 r100_irq_disable(rdev); 464 rs400_gart_disable(rdev); 465 return 0; 466} 467 468void rs400_fini(struct radeon_device *rdev) --- 62 unchanged lines hidden (view full) --- 531 /* Memory manager */ 532 r = radeon_bo_init(rdev); 533 if (r) 534 return r; 535 r = rs400_gart_init(rdev); 536 if (r) 537 return r; 538 r300_set_reg_safe(rdev); | 471 r100_cp_disable(rdev); 472 radeon_wb_disable(rdev); 473 r100_irq_disable(rdev); 474 rs400_gart_disable(rdev); 475 return 0; 476} 477 478void rs400_fini(struct radeon_device *rdev) --- 62 unchanged lines hidden (view full) --- 541 /* Memory manager */ 542 r = radeon_bo_init(rdev); 543 if (r) 544 return r; 545 r = rs400_gart_init(rdev); 546 if (r) 547 return r; 548 r300_set_reg_safe(rdev); |
549 550 r = radeon_ib_pool_init(rdev); |
|
539 rdev->accel_working = true; | 551 rdev->accel_working = true; |
552 if (r) { 553 dev_err(rdev->dev, "IB initialization failed (%d).\n", r); 554 rdev->accel_working = false; 555 } 556 |
|
540 r = rs400_startup(rdev); 541 if (r) { 542 /* Somethings want wront with the accel init stop accel */ 543 dev_err(rdev->dev, "Disabling GPU acceleration\n"); 544 r100_cp_fini(rdev); 545 radeon_wb_fini(rdev); 546 r100_ib_fini(rdev); 547 rs400_gart_fini(rdev); 548 radeon_irq_kms_fini(rdev); 549 rdev->accel_working = false; 550 } 551 return 0; 552} | 557 r = rs400_startup(rdev); 558 if (r) { 559 /* Somethings want wront with the accel init stop accel */ 560 dev_err(rdev->dev, "Disabling GPU acceleration\n"); 561 r100_cp_fini(rdev); 562 radeon_wb_fini(rdev); 563 r100_ib_fini(rdev); 564 rs400_gart_fini(rdev); 565 radeon_irq_kms_fini(rdev); 566 rdev->accel_working = false; 567 } 568 return 0; 569} |