amdgpu/dc: don't check for 0 on register read/writes always.
This adds ~50k to the driver text segment, and 10k to data segment. text data bss dec hex filename 2385556 39681 1045 2426282 2505aa drivers/gpu/drm/amd/amdgpu/amdgpu.o text data bss dec hex filename 2336593 28857 1045 2366495 241c1f drivers/gpu/drm/amd/amdgpu/amdgpu.o Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
5e0adbff08
commit
e9d7dc62bc
@ -96,6 +96,9 @@ irq_handler_idx dm_register_interrupt(
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* enable for debugging new code, this adds 50k to the driver size. */
|
||||||
|
/* #define DM_CHECK_ADDR_0 */
|
||||||
|
|
||||||
#define dm_read_reg(ctx, address) \
|
#define dm_read_reg(ctx, address) \
|
||||||
dm_read_reg_func(ctx, address, __func__)
|
dm_read_reg_func(ctx, address, __func__)
|
||||||
|
|
||||||
@ -105,12 +108,12 @@ static inline uint32_t dm_read_reg_func(
|
|||||||
const char *func_name)
|
const char *func_name)
|
||||||
{
|
{
|
||||||
uint32_t value;
|
uint32_t value;
|
||||||
|
#ifdef DM_CHECK_ADDR_0
|
||||||
if (address == 0) {
|
if (address == 0) {
|
||||||
DC_ERR("invalid register read; address = 0\n");
|
DC_ERR("invalid register read; address = 0\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
value = cgs_read_register(ctx->cgs_device, address);
|
value = cgs_read_register(ctx->cgs_device, address);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
@ -125,10 +128,12 @@ static inline void dm_write_reg_func(
|
|||||||
uint32_t value,
|
uint32_t value,
|
||||||
const char *func_name)
|
const char *func_name)
|
||||||
{
|
{
|
||||||
|
#ifdef DM_CHECK_ADDR_0
|
||||||
if (address == 0) {
|
if (address == 0) {
|
||||||
DC_ERR("invalid register write. address = 0");
|
DC_ERR("invalid register write. address = 0");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
cgs_write_register(ctx->cgs_device, address, value);
|
cgs_write_register(ctx->cgs_device, address, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user