]> Git Repo - linux.git/commitdiff
drm/i915/guc: Sanitory checks for platform that dont have GuC
authorAnusha Srivatsa <[email protected]>
Fri, 14 Oct 2016 23:47:05 +0000 (16:47 -0700)
committerPaulo Zanoni <[email protected]>
Tue, 18 Oct 2016 12:30:00 +0000 (10:30 -0200)
i915.enable_guc_loading/submission=2 forces the usage of GuC.
For platforms that do not have a GuC, asking the kernel to use a GuC
should not result in an error state. Do extra checks to see if the
platform even has a GuC or not, regardless of the kernel parameter.

v2: Based on Rodrigo's patch and Paulo's suggestion(Paulo, Rodrigo)
v3: Correct the Indentation(Jani, Paulo)
v4: Added the blank line(Jani, Paulo)
v5 (from Paulo): Remove the extra blank line.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97573
Cc: Rodrigo Vivi <[email protected]>
Cc: Zanoni Paulo <[email protected]>
Cc: Jani Nikula <[email protected]>
Reviewed-by: Paulo Zanoni <[email protected]>
Signed-off-by: Anusha Srivatsa <[email protected]>
Signed-off-by: Paulo Zanoni <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/i915/intel_guc_loader.c

index 678b51a24a23f1af64396b783ca7e153e1252e8e..3c8eaae13732ac2f40220defc18442ff86e06c7b 100644 (file)
@@ -719,11 +719,16 @@ void intel_guc_init(struct drm_device *dev)
        struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
        const char *fw_path;
 
-       /* A negative value means "use platform default" */
-       if (i915.enable_guc_loading < 0)
-               i915.enable_guc_loading = HAS_GUC_UCODE(dev);
-       if (i915.enable_guc_submission < 0)
-               i915.enable_guc_submission = HAS_GUC_SCHED(dev);
+       if (!HAS_GUC(dev)) {
+               i915.enable_guc_loading = 0;
+               i915.enable_guc_submission = 0;
+       } else {
+               /* A negative value means "use platform default" */
+               if (i915.enable_guc_loading < 0)
+                       i915.enable_guc_loading = HAS_GUC_UCODE(dev);
+               if (i915.enable_guc_submission < 0)
+                       i915.enable_guc_submission = HAS_GUC_SCHED(dev);
+       }
 
        if (!HAS_GUC_UCODE(dev)) {
                fw_path = NULL;
This page took 0.051674 seconds and 4 git commands to generate.