Commit 901ea57d authored by Alex Deucher's avatar Alex Deucher Committed by Dave Airlie

drm/radeon/kms: reorganize hpd callbacks

tidy up the radeon_asic struct.
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Reviewed-by: default avatarJerome Glisse <jglisse@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 89e5181f
...@@ -1182,10 +1182,14 @@ struct radeon_asic { ...@@ -1182,10 +1182,14 @@ struct radeon_asic {
uint32_t offset, uint32_t obj_size); uint32_t offset, uint32_t obj_size);
void (*clear_surface_reg)(struct radeon_device *rdev, int reg); void (*clear_surface_reg)(struct radeon_device *rdev, int reg);
void (*bandwidth_update)(struct radeon_device *rdev); void (*bandwidth_update)(struct radeon_device *rdev);
void (*hpd_init)(struct radeon_device *rdev);
void (*hpd_fini)(struct radeon_device *rdev); struct {
bool (*hpd_sense)(struct radeon_device *rdev, enum radeon_hpd_id hpd); void (*init)(struct radeon_device *rdev);
void (*hpd_set_polarity)(struct radeon_device *rdev, enum radeon_hpd_id hpd); void (*fini)(struct radeon_device *rdev);
bool (*sense)(struct radeon_device *rdev, enum radeon_hpd_id hpd);
void (*set_polarity)(struct radeon_device *rdev, enum radeon_hpd_id hpd);
} hpd;
/* ioctl hw specific callback. Some hw might want to perform special /* ioctl hw specific callback. Some hw might want to perform special
* operation on specific ioctl. For instance on wait idle some hw * operation on specific ioctl. For instance on wait idle some hw
* might want to perform and HDP flush through MMIO as it seems that * might want to perform and HDP flush through MMIO as it seems that
...@@ -1683,10 +1687,10 @@ void radeon_ring_write(struct radeon_ring *ring, uint32_t v); ...@@ -1683,10 +1687,10 @@ void radeon_ring_write(struct radeon_ring *ring, uint32_t v);
#define radeon_set_surface_reg(rdev, r, f, p, o, s) ((rdev)->asic->set_surface_reg((rdev), (r), (f), (p), (o), (s))) #define radeon_set_surface_reg(rdev, r, f, p, o, s) ((rdev)->asic->set_surface_reg((rdev), (r), (f), (p), (o), (s)))
#define radeon_clear_surface_reg(rdev, r) ((rdev)->asic->clear_surface_reg((rdev), (r))) #define radeon_clear_surface_reg(rdev, r) ((rdev)->asic->clear_surface_reg((rdev), (r)))
#define radeon_bandwidth_update(rdev) (rdev)->asic->bandwidth_update((rdev)) #define radeon_bandwidth_update(rdev) (rdev)->asic->bandwidth_update((rdev))
#define radeon_hpd_init(rdev) (rdev)->asic->hpd_init((rdev)) #define radeon_hpd_init(rdev) (rdev)->asic->hpd.init((rdev))
#define radeon_hpd_fini(rdev) (rdev)->asic->hpd_fini((rdev)) #define radeon_hpd_fini(rdev) (rdev)->asic->hpd.fini((rdev))
#define radeon_hpd_sense(rdev, hpd) (rdev)->asic->hpd_sense((rdev), (hpd)) #define radeon_hpd_sense(rdev, h) (rdev)->asic->hpd.sense((rdev), (h))
#define radeon_hpd_set_polarity(rdev, hpd) (rdev)->asic->hpd_set_polarity((rdev), (hpd)) #define radeon_hpd_set_polarity(rdev, h) (rdev)->asic->hpd.set_polarity((rdev), (h))
#define radeon_gui_idle(rdev) (rdev)->asic->gui_idle((rdev)) #define radeon_gui_idle(rdev) (rdev)->asic->gui_idle((rdev))
#define radeon_pm_misc(rdev) (rdev)->asic->pm_misc((rdev)) #define radeon_pm_misc(rdev) (rdev)->asic->pm_misc((rdev))
#define radeon_pm_prepare(rdev) (rdev)->asic->pm_prepare((rdev)) #define radeon_pm_prepare(rdev) (rdev)->asic->pm_prepare((rdev))
......
...@@ -164,10 +164,12 @@ static struct radeon_asic r100_asic = { ...@@ -164,10 +164,12 @@ static struct radeon_asic r100_asic = {
.set_surface_reg = r100_set_surface_reg, .set_surface_reg = r100_set_surface_reg,
.clear_surface_reg = r100_clear_surface_reg, .clear_surface_reg = r100_clear_surface_reg,
.bandwidth_update = &r100_bandwidth_update, .bandwidth_update = &r100_bandwidth_update,
.hpd_init = &r100_hpd_init, .hpd = {
.hpd_fini = &r100_hpd_fini, .init = &r100_hpd_init,
.hpd_sense = &r100_hpd_sense, .fini = &r100_hpd_fini,
.hpd_set_polarity = &r100_hpd_set_polarity, .sense = &r100_hpd_sense,
.set_polarity = &r100_hpd_set_polarity,
},
.ioctl_wait_idle = NULL, .ioctl_wait_idle = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.pm_misc = &r100_pm_misc, .pm_misc = &r100_pm_misc,
...@@ -217,10 +219,12 @@ static struct radeon_asic r200_asic = { ...@@ -217,10 +219,12 @@ static struct radeon_asic r200_asic = {
.set_surface_reg = r100_set_surface_reg, .set_surface_reg = r100_set_surface_reg,
.clear_surface_reg = r100_clear_surface_reg, .clear_surface_reg = r100_clear_surface_reg,
.bandwidth_update = &r100_bandwidth_update, .bandwidth_update = &r100_bandwidth_update,
.hpd_init = &r100_hpd_init, .hpd = {
.hpd_fini = &r100_hpd_fini, .init = &r100_hpd_init,
.hpd_sense = &r100_hpd_sense, .fini = &r100_hpd_fini,
.hpd_set_polarity = &r100_hpd_set_polarity, .sense = &r100_hpd_sense,
.set_polarity = &r100_hpd_set_polarity,
},
.ioctl_wait_idle = NULL, .ioctl_wait_idle = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.pm_misc = &r100_pm_misc, .pm_misc = &r100_pm_misc,
...@@ -271,10 +275,12 @@ static struct radeon_asic r300_asic = { ...@@ -271,10 +275,12 @@ static struct radeon_asic r300_asic = {
.set_surface_reg = r100_set_surface_reg, .set_surface_reg = r100_set_surface_reg,
.clear_surface_reg = r100_clear_surface_reg, .clear_surface_reg = r100_clear_surface_reg,
.bandwidth_update = &r100_bandwidth_update, .bandwidth_update = &r100_bandwidth_update,
.hpd_init = &r100_hpd_init, .hpd = {
.hpd_fini = &r100_hpd_fini, .init = &r100_hpd_init,
.hpd_sense = &r100_hpd_sense, .fini = &r100_hpd_fini,
.hpd_set_polarity = &r100_hpd_set_polarity, .sense = &r100_hpd_sense,
.set_polarity = &r100_hpd_set_polarity,
},
.ioctl_wait_idle = NULL, .ioctl_wait_idle = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.pm_misc = &r100_pm_misc, .pm_misc = &r100_pm_misc,
...@@ -324,10 +330,12 @@ static struct radeon_asic r300_asic_pcie = { ...@@ -324,10 +330,12 @@ static struct radeon_asic r300_asic_pcie = {
.set_surface_reg = r100_set_surface_reg, .set_surface_reg = r100_set_surface_reg,
.clear_surface_reg = r100_clear_surface_reg, .clear_surface_reg = r100_clear_surface_reg,
.bandwidth_update = &r100_bandwidth_update, .bandwidth_update = &r100_bandwidth_update,
.hpd_init = &r100_hpd_init, .hpd = {
.hpd_fini = &r100_hpd_fini, .init = &r100_hpd_init,
.hpd_sense = &r100_hpd_sense, .fini = &r100_hpd_fini,
.hpd_set_polarity = &r100_hpd_set_polarity, .sense = &r100_hpd_sense,
.set_polarity = &r100_hpd_set_polarity,
},
.ioctl_wait_idle = NULL, .ioctl_wait_idle = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.pm_misc = &r100_pm_misc, .pm_misc = &r100_pm_misc,
...@@ -378,10 +386,12 @@ static struct radeon_asic r420_asic = { ...@@ -378,10 +386,12 @@ static struct radeon_asic r420_asic = {
.set_surface_reg = r100_set_surface_reg, .set_surface_reg = r100_set_surface_reg,
.clear_surface_reg = r100_clear_surface_reg, .clear_surface_reg = r100_clear_surface_reg,
.bandwidth_update = &r100_bandwidth_update, .bandwidth_update = &r100_bandwidth_update,
.hpd_init = &r100_hpd_init, .hpd = {
.hpd_fini = &r100_hpd_fini, .init = &r100_hpd_init,
.hpd_sense = &r100_hpd_sense, .fini = &r100_hpd_fini,
.hpd_set_polarity = &r100_hpd_set_polarity, .sense = &r100_hpd_sense,
.set_polarity = &r100_hpd_set_polarity,
},
.ioctl_wait_idle = NULL, .ioctl_wait_idle = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.pm_misc = &r100_pm_misc, .pm_misc = &r100_pm_misc,
...@@ -432,10 +442,12 @@ static struct radeon_asic rs400_asic = { ...@@ -432,10 +442,12 @@ static struct radeon_asic rs400_asic = {
.set_surface_reg = r100_set_surface_reg, .set_surface_reg = r100_set_surface_reg,
.clear_surface_reg = r100_clear_surface_reg, .clear_surface_reg = r100_clear_surface_reg,
.bandwidth_update = &r100_bandwidth_update, .bandwidth_update = &r100_bandwidth_update,
.hpd_init = &r100_hpd_init, .hpd = {
.hpd_fini = &r100_hpd_fini, .init = &r100_hpd_init,
.hpd_sense = &r100_hpd_sense, .fini = &r100_hpd_fini,
.hpd_set_polarity = &r100_hpd_set_polarity, .sense = &r100_hpd_sense,
.set_polarity = &r100_hpd_set_polarity,
},
.ioctl_wait_idle = NULL, .ioctl_wait_idle = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.pm_misc = &r100_pm_misc, .pm_misc = &r100_pm_misc,
...@@ -486,10 +498,12 @@ static struct radeon_asic rs600_asic = { ...@@ -486,10 +498,12 @@ static struct radeon_asic rs600_asic = {
.set_surface_reg = r100_set_surface_reg, .set_surface_reg = r100_set_surface_reg,
.clear_surface_reg = r100_clear_surface_reg, .clear_surface_reg = r100_clear_surface_reg,
.bandwidth_update = &rs600_bandwidth_update, .bandwidth_update = &rs600_bandwidth_update,
.hpd_init = &rs600_hpd_init, .hpd = {
.hpd_fini = &rs600_hpd_fini, .init = &rs600_hpd_init,
.hpd_sense = &rs600_hpd_sense, .fini = &rs600_hpd_fini,
.hpd_set_polarity = &rs600_hpd_set_polarity, .sense = &rs600_hpd_sense,
.set_polarity = &rs600_hpd_set_polarity,
},
.ioctl_wait_idle = NULL, .ioctl_wait_idle = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.pm_misc = &rs600_pm_misc, .pm_misc = &rs600_pm_misc,
...@@ -540,10 +554,12 @@ static struct radeon_asic rs690_asic = { ...@@ -540,10 +554,12 @@ static struct radeon_asic rs690_asic = {
.set_surface_reg = r100_set_surface_reg, .set_surface_reg = r100_set_surface_reg,
.clear_surface_reg = r100_clear_surface_reg, .clear_surface_reg = r100_clear_surface_reg,
.bandwidth_update = &rs690_bandwidth_update, .bandwidth_update = &rs690_bandwidth_update,
.hpd_init = &rs600_hpd_init, .hpd = {
.hpd_fini = &rs600_hpd_fini, .init = &rs600_hpd_init,
.hpd_sense = &rs600_hpd_sense, .fini = &rs600_hpd_fini,
.hpd_set_polarity = &rs600_hpd_set_polarity, .sense = &rs600_hpd_sense,
.set_polarity = &rs600_hpd_set_polarity,
},
.ioctl_wait_idle = NULL, .ioctl_wait_idle = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.pm_misc = &rs600_pm_misc, .pm_misc = &rs600_pm_misc,
...@@ -594,10 +610,12 @@ static struct radeon_asic rv515_asic = { ...@@ -594,10 +610,12 @@ static struct radeon_asic rv515_asic = {
.set_surface_reg = r100_set_surface_reg, .set_surface_reg = r100_set_surface_reg,
.clear_surface_reg = r100_clear_surface_reg, .clear_surface_reg = r100_clear_surface_reg,
.bandwidth_update = &rv515_bandwidth_update, .bandwidth_update = &rv515_bandwidth_update,
.hpd_init = &rs600_hpd_init, .hpd = {
.hpd_fini = &rs600_hpd_fini, .init = &rs600_hpd_init,
.hpd_sense = &rs600_hpd_sense, .fini = &rs600_hpd_fini,
.hpd_set_polarity = &rs600_hpd_set_polarity, .sense = &rs600_hpd_sense,
.set_polarity = &rs600_hpd_set_polarity,
},
.ioctl_wait_idle = NULL, .ioctl_wait_idle = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.pm_misc = &rs600_pm_misc, .pm_misc = &rs600_pm_misc,
...@@ -648,10 +666,12 @@ static struct radeon_asic r520_asic = { ...@@ -648,10 +666,12 @@ static struct radeon_asic r520_asic = {
.set_surface_reg = r100_set_surface_reg, .set_surface_reg = r100_set_surface_reg,
.clear_surface_reg = r100_clear_surface_reg, .clear_surface_reg = r100_clear_surface_reg,
.bandwidth_update = &rv515_bandwidth_update, .bandwidth_update = &rv515_bandwidth_update,
.hpd_init = &rs600_hpd_init, .hpd = {
.hpd_fini = &rs600_hpd_fini, .init = &rs600_hpd_init,
.hpd_sense = &rs600_hpd_sense, .fini = &rs600_hpd_fini,
.hpd_set_polarity = &rs600_hpd_set_polarity, .sense = &rs600_hpd_sense,
.set_polarity = &rs600_hpd_set_polarity,
},
.ioctl_wait_idle = NULL, .ioctl_wait_idle = NULL,
.gui_idle = &r100_gui_idle, .gui_idle = &r100_gui_idle,
.pm_misc = &rs600_pm_misc, .pm_misc = &rs600_pm_misc,
...@@ -701,10 +721,12 @@ static struct radeon_asic r600_asic = { ...@@ -701,10 +721,12 @@ static struct radeon_asic r600_asic = {
.set_surface_reg = r600_set_surface_reg, .set_surface_reg = r600_set_surface_reg,
.clear_surface_reg = r600_clear_surface_reg, .clear_surface_reg = r600_clear_surface_reg,
.bandwidth_update = &rv515_bandwidth_update, .bandwidth_update = &rv515_bandwidth_update,
.hpd_init = &r600_hpd_init, .hpd = {
.hpd_fini = &r600_hpd_fini, .init = &r600_hpd_init,
.hpd_sense = &r600_hpd_sense, .fini = &r600_hpd_fini,
.hpd_set_polarity = &r600_hpd_set_polarity, .sense = &r600_hpd_sense,
.set_polarity = &r600_hpd_set_polarity,
},
.ioctl_wait_idle = r600_ioctl_wait_idle, .ioctl_wait_idle = r600_ioctl_wait_idle,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.pm_misc = &r600_pm_misc, .pm_misc = &r600_pm_misc,
...@@ -754,10 +776,12 @@ static struct radeon_asic rs780_asic = { ...@@ -754,10 +776,12 @@ static struct radeon_asic rs780_asic = {
.set_surface_reg = r600_set_surface_reg, .set_surface_reg = r600_set_surface_reg,
.clear_surface_reg = r600_clear_surface_reg, .clear_surface_reg = r600_clear_surface_reg,
.bandwidth_update = &rs690_bandwidth_update, .bandwidth_update = &rs690_bandwidth_update,
.hpd_init = &r600_hpd_init, .hpd = {
.hpd_fini = &r600_hpd_fini, .init = &r600_hpd_init,
.hpd_sense = &r600_hpd_sense, .fini = &r600_hpd_fini,
.hpd_set_polarity = &r600_hpd_set_polarity, .sense = &r600_hpd_sense,
.set_polarity = &r600_hpd_set_polarity,
},
.ioctl_wait_idle = r600_ioctl_wait_idle, .ioctl_wait_idle = r600_ioctl_wait_idle,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.pm_misc = &r600_pm_misc, .pm_misc = &r600_pm_misc,
...@@ -807,10 +831,12 @@ static struct radeon_asic rv770_asic = { ...@@ -807,10 +831,12 @@ static struct radeon_asic rv770_asic = {
.set_surface_reg = r600_set_surface_reg, .set_surface_reg = r600_set_surface_reg,
.clear_surface_reg = r600_clear_surface_reg, .clear_surface_reg = r600_clear_surface_reg,
.bandwidth_update = &rv515_bandwidth_update, .bandwidth_update = &rv515_bandwidth_update,
.hpd_init = &r600_hpd_init, .hpd = {
.hpd_fini = &r600_hpd_fini, .init = &r600_hpd_init,
.hpd_sense = &r600_hpd_sense, .fini = &r600_hpd_fini,
.hpd_set_polarity = &r600_hpd_set_polarity, .sense = &r600_hpd_sense,
.set_polarity = &r600_hpd_set_polarity,
},
.ioctl_wait_idle = r600_ioctl_wait_idle, .ioctl_wait_idle = r600_ioctl_wait_idle,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.pm_misc = &rv770_pm_misc, .pm_misc = &rv770_pm_misc,
...@@ -860,10 +886,12 @@ static struct radeon_asic evergreen_asic = { ...@@ -860,10 +886,12 @@ static struct radeon_asic evergreen_asic = {
.set_surface_reg = r600_set_surface_reg, .set_surface_reg = r600_set_surface_reg,
.clear_surface_reg = r600_clear_surface_reg, .clear_surface_reg = r600_clear_surface_reg,
.bandwidth_update = &evergreen_bandwidth_update, .bandwidth_update = &evergreen_bandwidth_update,
.hpd_init = &evergreen_hpd_init, .hpd = {
.hpd_fini = &evergreen_hpd_fini, .init = &evergreen_hpd_init,
.hpd_sense = &evergreen_hpd_sense, .fini = &evergreen_hpd_fini,
.hpd_set_polarity = &evergreen_hpd_set_polarity, .sense = &evergreen_hpd_sense,
.set_polarity = &evergreen_hpd_set_polarity,
},
.ioctl_wait_idle = r600_ioctl_wait_idle, .ioctl_wait_idle = r600_ioctl_wait_idle,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.pm_misc = &evergreen_pm_misc, .pm_misc = &evergreen_pm_misc,
...@@ -913,10 +941,12 @@ static struct radeon_asic sumo_asic = { ...@@ -913,10 +941,12 @@ static struct radeon_asic sumo_asic = {
.set_surface_reg = r600_set_surface_reg, .set_surface_reg = r600_set_surface_reg,
.clear_surface_reg = r600_clear_surface_reg, .clear_surface_reg = r600_clear_surface_reg,
.bandwidth_update = &evergreen_bandwidth_update, .bandwidth_update = &evergreen_bandwidth_update,
.hpd_init = &evergreen_hpd_init, .hpd = {
.hpd_fini = &evergreen_hpd_fini, .init = &evergreen_hpd_init,
.hpd_sense = &evergreen_hpd_sense, .fini = &evergreen_hpd_fini,
.hpd_set_polarity = &evergreen_hpd_set_polarity, .sense = &evergreen_hpd_sense,
.set_polarity = &evergreen_hpd_set_polarity,
},
.ioctl_wait_idle = r600_ioctl_wait_idle, .ioctl_wait_idle = r600_ioctl_wait_idle,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.pm_misc = &evergreen_pm_misc, .pm_misc = &evergreen_pm_misc,
...@@ -966,10 +996,12 @@ static struct radeon_asic btc_asic = { ...@@ -966,10 +996,12 @@ static struct radeon_asic btc_asic = {
.set_surface_reg = r600_set_surface_reg, .set_surface_reg = r600_set_surface_reg,
.clear_surface_reg = r600_clear_surface_reg, .clear_surface_reg = r600_clear_surface_reg,
.bandwidth_update = &evergreen_bandwidth_update, .bandwidth_update = &evergreen_bandwidth_update,
.hpd_init = &evergreen_hpd_init, .hpd = {
.hpd_fini = &evergreen_hpd_fini, .init = &evergreen_hpd_init,
.hpd_sense = &evergreen_hpd_sense, .fini = &evergreen_hpd_fini,
.hpd_set_polarity = &evergreen_hpd_set_polarity, .sense = &evergreen_hpd_sense,
.set_polarity = &evergreen_hpd_set_polarity,
},
.ioctl_wait_idle = r600_ioctl_wait_idle, .ioctl_wait_idle = r600_ioctl_wait_idle,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.pm_misc = &evergreen_pm_misc, .pm_misc = &evergreen_pm_misc,
...@@ -1042,10 +1074,12 @@ static struct radeon_asic cayman_asic = { ...@@ -1042,10 +1074,12 @@ static struct radeon_asic cayman_asic = {
.set_surface_reg = r600_set_surface_reg, .set_surface_reg = r600_set_surface_reg,
.clear_surface_reg = r600_clear_surface_reg, .clear_surface_reg = r600_clear_surface_reg,
.bandwidth_update = &evergreen_bandwidth_update, .bandwidth_update = &evergreen_bandwidth_update,
.hpd_init = &evergreen_hpd_init, .hpd = {
.hpd_fini = &evergreen_hpd_fini, .init = &evergreen_hpd_init,
.hpd_sense = &evergreen_hpd_sense, .fini = &evergreen_hpd_fini,
.hpd_set_polarity = &evergreen_hpd_set_polarity, .sense = &evergreen_hpd_sense,
.set_polarity = &evergreen_hpd_set_polarity,
},
.ioctl_wait_idle = r600_ioctl_wait_idle, .ioctl_wait_idle = r600_ioctl_wait_idle,
.gui_idle = &r600_gui_idle, .gui_idle = &r600_gui_idle,
.pm_misc = &evergreen_pm_misc, .pm_misc = &evergreen_pm_misc,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment