@@ -52,6 +52,7 @@ struct ade_hw_ctx {
struct clk *media_noc_clk;
struct clk *ade_pix_clk;
struct reset_control *reset;
+ struct work_struct display_reset_wq;
bool power_on;
int irq;
@@ -61,7 +62,6 @@ struct ade_hw_ctx {
struct kirin_crtc {
struct drm_crtc base;
void *hw_ctx;
- struct work_struct display_reset_wq;
bool enable;
};
@@ -349,9 +349,9 @@ static void ade_crtc_disable_vblank(struct drm_crtc *crtc)
static void drm_underflow_wq(struct work_struct *work)
{
- struct kirin_crtc *acrtc = container_of(work, struct kirin_crtc,
+ struct ade_hw_ctx *ctx = container_of(work, struct ade_hw_ctx,
display_reset_wq);
- struct drm_device *drm_dev = (&acrtc->base)->dev;
+ struct drm_device *drm_dev = ctx->crtc->dev;
struct drm_atomic_state *state;
state = drm_atomic_helper_suspend(drm_dev);
@@ -362,7 +362,6 @@ static irqreturn_t ade_irq_handler(int irq, void *data)
{
struct ade_hw_ctx *ctx = data;
struct drm_crtc *crtc = ctx->crtc;
- struct kirin_crtc *kcrtc = to_kirin_crtc(crtc);
void __iomem *base = ctx->base;
u32 status;
@@ -379,7 +378,7 @@ static irqreturn_t ade_irq_handler(int irq, void *data)
ade_update_bits(base + LDI_INT_CLR, UNDERFLOW_INT_EN_OFST,
MASK(1), 1);
DRM_ERROR("LDI underflow!");
- schedule_work(&kcrtc->display_reset_wq);
+ schedule_work(&ctx->display_reset_wq);
}
return IRQ_HANDLED;
@@ -1016,6 +1015,7 @@ static void *ade_hw_ctx_alloc(struct platform_device *pdev,
if (ret)
return ERR_PTR(-EIO);
+ INIT_WORK(&ctx->display_reset_wq, drm_underflow_wq);
ctx->crtc = crtc;
return ctx;
@@ -1071,8 +1071,6 @@ static int ade_drm_init(struct platform_device *pdev)
if (ret)
return ret;
- INIT_WORK(&kcrtc->display_reset_wq, drm_underflow_wq);
-
return 0;
}