]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Introduce to_gt() helper
authorMichał Winiarski <michal.winiarski@intel.com>
Tue, 14 Dec 2021 19:33:32 +0000 (21:33 +0200)
committerMatt Roper <matthew.d.roper@intel.com>
Sat, 18 Dec 2021 05:47:36 +0000 (21:47 -0800)
To allow further refactoring and abstract away the fact that GT is
stored inside i915 private.
No functional changes.

Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211214193346.21231-3-andi.shyti@linux.intel.com
drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c
drivers/gpu/drm/i915/i915_drv.h

index acc49c56a9f30bd8cfe19273e111ba06a0ae27a6..9db3dcbd917f7f5a4be97db96d474c69d892a45a 100644 (file)
@@ -9,11 +9,6 @@
 #include "intel_engine_pm.h"
 #include "intel_gt_buffer_pool.h"
 
-static struct intel_gt *to_gt(struct intel_gt_buffer_pool *pool)
-{
-       return container_of(pool, struct intel_gt, buffer_pool);
-}
-
 static struct list_head *
 bucket_for_size(struct intel_gt_buffer_pool *pool, size_t sz)
 {
@@ -141,7 +136,7 @@ static struct intel_gt_buffer_pool_node *
 node_create(struct intel_gt_buffer_pool *pool, size_t sz,
            enum i915_map_type type)
 {
-       struct intel_gt *gt = to_gt(pool);
+       struct intel_gt *gt = container_of(pool, struct intel_gt, buffer_pool);
        struct intel_gt_buffer_pool_node *node;
        struct drm_i915_gem_object *obj;
 
index e02becc680ec04d736b4cb6e2835f409374cbe50..bdc81092fe24ba81cba01cb4ad0bb222dc66d283 100644 (file)
@@ -1268,6 +1268,11 @@ static inline struct drm_i915_private *pdev_to_i915(struct pci_dev *pdev)
        return pci_get_drvdata(pdev);
 }
 
+static inline struct intel_gt *to_gt(struct drm_i915_private *i915)
+{
+       return &i915->gt;
+}
+
 /* Simple iterator over all initialised engines */
 #define for_each_engine(engine__, dev_priv__, id__) \
        for ((id__) = 0; \