mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-09 01:47:20 -04:00
drm/i915/display: pass struct pci_dev * to intel_display_device_probe()
Convert intel_display_device_probe() to accept struct pci_dev * instead of struct drm_i915_private *. Return struct intel_display * in preparation of allocating the memory of it later. Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/ab4e960e3fff46cbeba185882b1e554f0ccd5877.1731321183.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "intel_display_params.h"
|
||||
#include "intel_display_power.h"
|
||||
#include "intel_display_reg_defs.h"
|
||||
#include "intel_display_types.h"
|
||||
#include "intel_fbc.h"
|
||||
#include "intel_step.h"
|
||||
|
||||
@@ -1569,10 +1570,9 @@ static void display_platforms_or(struct intel_display_platforms *dst,
|
||||
bitmap_or(dst->bitmap, dst->bitmap, src->bitmap, display_platforms_num_bits());
|
||||
}
|
||||
|
||||
void intel_display_device_probe(struct drm_i915_private *i915)
|
||||
struct intel_display *intel_display_device_probe(struct pci_dev *pdev)
|
||||
{
|
||||
struct intel_display *display = &i915->display;
|
||||
struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
|
||||
struct intel_display *display = to_intel_display(pdev);
|
||||
const struct intel_display_device_info *info;
|
||||
struct intel_display_ip_ver ip_ver = {};
|
||||
const struct platform_desc *desc;
|
||||
@@ -1649,10 +1649,12 @@ void intel_display_device_probe(struct drm_i915_private *i915)
|
||||
DISPLAY_RUNTIME_INFO(display)->ip.rel,
|
||||
step != STEP_NONE ? intel_step_name(step) : "N/A");
|
||||
|
||||
return;
|
||||
return display;
|
||||
|
||||
no_display:
|
||||
DISPLAY_INFO(display) = &no_display;
|
||||
|
||||
return display;
|
||||
}
|
||||
|
||||
void intel_display_device_remove(struct intel_display *display)
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
#include "intel_display_conversion.h"
|
||||
#include "intel_display_limits.h"
|
||||
|
||||
struct drm_i915_private;
|
||||
struct drm_printer;
|
||||
struct intel_display;
|
||||
struct pci_dev;
|
||||
|
||||
/*
|
||||
* Display platforms and subplatforms. Keep platforms in display version based
|
||||
@@ -290,7 +290,7 @@ struct intel_display_device_info {
|
||||
};
|
||||
|
||||
bool intel_display_device_enabled(struct intel_display *display);
|
||||
void intel_display_device_probe(struct drm_i915_private *i915);
|
||||
struct intel_display *intel_display_device_probe(struct pci_dev *pdev);
|
||||
void intel_display_device_remove(struct intel_display *display);
|
||||
void intel_display_device_info_runtime_init(struct intel_display *display);
|
||||
|
||||
|
||||
@@ -736,7 +736,7 @@ i915_driver_create(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
/* Set up device info and initial runtime info. */
|
||||
intel_device_info_driver_create(i915, pdev->device, match_info);
|
||||
|
||||
intel_display_device_probe(i915);
|
||||
intel_display_device_probe(pdev);
|
||||
|
||||
return i915;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ struct drm_i915_private *mock_gem_device(void)
|
||||
/* Set up device info and initial runtime info. */
|
||||
intel_device_info_driver_create(i915, pdev->device, &mock_info);
|
||||
|
||||
intel_display_device_probe(i915);
|
||||
intel_display_device_probe(pdev);
|
||||
|
||||
dev_pm_domain_set(&pdev->dev, &pm_domain);
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
||||
@@ -492,13 +492,14 @@ static void display_device_remove(struct drm_device *dev, void *arg)
|
||||
|
||||
int xe_display_probe(struct xe_device *xe)
|
||||
{
|
||||
struct intel_display *display = &xe->display;
|
||||
struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
|
||||
struct intel_display *display;
|
||||
int err;
|
||||
|
||||
if (!xe->info.probe_display)
|
||||
goto no_display;
|
||||
|
||||
intel_display_device_probe(xe);
|
||||
display = intel_display_device_probe(pdev);
|
||||
|
||||
err = drmm_add_action_or_reset(&xe->drm, display_device_remove, display);
|
||||
if (err)
|
||||
|
||||
Reference in New Issue
Block a user