Commit 5c4d2536 authored by Vitaly Lubart's avatar Vitaly Lubart Committed by Joonas Lahtinen

drm/i915/gsc: skip irq initialization if using polling

Some platforms require the host to poll on the
GSC registers instead of relaying on the interrupts.
For those platforms, irq initialization should be skipped
Signed-off-by: default avatarVitaly Lubart <vitaly.lubart@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Reviewed-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220907215113.1596567-2-tomas.winkler@intel.comSigned-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
parent 04f7eb3d
...@@ -40,6 +40,7 @@ struct gsc_def { ...@@ -40,6 +40,7 @@ struct gsc_def {
const char *name; const char *name;
unsigned long bar; unsigned long bar;
size_t bar_size; size_t bar_size;
bool use_polling;
}; };
/* gsc resources and definitions (HECI1 and HECI2) */ /* gsc resources and definitions (HECI1 and HECI2) */
...@@ -117,6 +118,10 @@ static void gsc_init_one(struct drm_i915_private *i915, ...@@ -117,6 +118,10 @@ static void gsc_init_one(struct drm_i915_private *i915,
return; return;
} }
/* skip irq initialization */
if (def->use_polling)
goto add_device;
intf->irq = irq_alloc_desc(0); intf->irq = irq_alloc_desc(0);
if (intf->irq < 0) { if (intf->irq < 0) {
drm_err(&i915->drm, "gsc irq error %d\n", intf->irq); drm_err(&i915->drm, "gsc irq error %d\n", intf->irq);
...@@ -129,6 +134,7 @@ static void gsc_init_one(struct drm_i915_private *i915, ...@@ -129,6 +134,7 @@ static void gsc_init_one(struct drm_i915_private *i915,
goto fail; goto fail;
} }
add_device:
adev = kzalloc(sizeof(*adev), GFP_KERNEL); adev = kzalloc(sizeof(*adev), GFP_KERNEL);
if (!adev) if (!adev)
goto fail; goto fail;
...@@ -182,10 +188,8 @@ static void gsc_irq_handler(struct intel_gt *gt, unsigned int intf_id) ...@@ -182,10 +188,8 @@ static void gsc_irq_handler(struct intel_gt *gt, unsigned int intf_id)
return; return;
} }
if (gt->gsc.intf[intf_id].irq < 0) { if (gt->gsc.intf[intf_id].irq < 0)
drm_err_ratelimited(&gt->i915->drm, "GSC irq: irq not set");
return; return;
}
ret = generic_handle_irq(gt->gsc.intf[intf_id].irq); ret = generic_handle_irq(gt->gsc.intf[intf_id].irq);
if (ret) if (ret)
......
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