drm/i915/perf: Add support for OA media units
[linux-2.6-microblaze.git] / drivers / gpu / drm / i915 / i915_pci.c
index a65802b..c3231e3 100644 (file)
@@ -423,7 +423,8 @@ static const struct intel_device_info ilk_m_info = {
        .has_coherent_ggtt = true, \
        .has_llc = 1, \
        .has_rc6 = 1, \
-       .has_rc6p = 1, \
+       /* snb does support rc6p, but enabling it causes various issues */ \
+       .has_rc6p = 0, \
        .has_rps = true, \
        .dma_mask_size = 40, \
        .__runtime.ppgtt_type = INTEL_PPGTT_ALIASING, \
@@ -1026,6 +1027,7 @@ static const struct intel_device_info adl_p_info = {
        .has_mslice_steering = 1, \
        .has_oa_bpc_reporting = 1, \
        .has_oa_slice_contrib_limits = 1, \
+       .has_oam = 1, \
        .has_rc6 = 1, \
        .has_reset_engine = 1, \
        .has_rps = 1, \
@@ -1125,7 +1127,7 @@ static const struct intel_gt_definition xelpmp_extra_gt[] = {
                .type = GT_MEDIA,
                .name = "Standalone Media GT",
                .gsi_offset = MTL_MEDIA_GSI_BASE,
-               .engine_mask = BIT(VECS0) | BIT(VCS0) | BIT(VCS2),
+               .engine_mask = BIT(VECS0) | BIT(VCS0) | BIT(VCS2) | BIT(GSC0),
        },
        {}
 };
@@ -1253,7 +1255,7 @@ static void i915_pci_remove(struct pci_dev *pdev)
 }
 
 /* is device_id present in comma separated list of ids */
-static bool force_probe(u16 device_id, const char *devices)
+static bool device_id_in_list(u16 device_id, const char *devices, bool negative)
 {
        char *s, *p, *tok;
        bool ret;
@@ -1262,7 +1264,9 @@ static bool force_probe(u16 device_id, const char *devices)
                return false;
 
        /* match everything */
-       if (strcmp(devices, "*") == 0)
+       if (negative && strcmp(devices, "!*") == 0)
+               return true;
+       if (!negative && strcmp(devices, "*") == 0)
                return true;
 
        s = kstrdup(devices, GFP_KERNEL);
@@ -1272,6 +1276,12 @@ static bool force_probe(u16 device_id, const char *devices)
        for (p = s, ret = false; (tok = strsep(&p, ",")) != NULL; ) {
                u16 val;
 
+               if (negative && tok[0] == '!')
+                       tok++;
+               else if ((negative && tok[0] != '!') ||
+                        (!negative && tok[0] == '!'))
+                       continue;
+
                if (kstrtou16(tok, 16, &val) == 0 && val == device_id) {
                        ret = true;
                        break;
@@ -1283,6 +1293,16 @@ static bool force_probe(u16 device_id, const char *devices)
        return ret;
 }
 
+static bool id_forced(u16 device_id)
+{
+       return device_id_in_list(device_id, i915_modparams.force_probe, false);
+}
+
+static bool id_blocked(u16 device_id)
+{
+       return device_id_in_list(device_id, i915_modparams.force_probe, true);
+}
+
 bool i915_pci_resource_valid(struct pci_dev *pdev, int bar)
 {
        if (!pci_resource_flags(pdev, bar))
@@ -1308,10 +1328,9 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                (struct intel_device_info *) ent->driver_data;
        int err;
 
-       if (intel_info->require_force_probe &&
-           !force_probe(pdev->device, i915_modparams.force_probe)) {
+       if (intel_info->require_force_probe && !id_forced(pdev->device)) {
                dev_info(&pdev->dev,
-                        "Your graphics device %04x is not properly supported by the driver in this\n"
+                        "Your graphics device %04x is not properly supported by i915 in this\n"
                         "kernel version. To force driver probe anyway, use i915.force_probe=%04x\n"
                         "module parameter or CONFIG_DRM_I915_FORCE_PROBE=%04x configuration option,\n"
                         "or (recommended) check for kernel updates.\n",
@@ -1319,6 +1338,12 @@ static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                return -ENODEV;
        }
 
+       if (id_blocked(pdev->device)) {
+               dev_info(&pdev->dev, "I915 probe blocked for Device ID %04x.\n",
+                        pdev->device);
+               return -ENODEV;
+       }
+
        /* Only bind to function 0 of the device. Early generations
         * used function 1 as a placeholder for multi-head. This causes
         * us confusion instead, especially on the systems where both