Commit 51d66a7b authored by Jacek Lawrynowicz's avatar Jacek Lawrynowicz Committed by Stanislaw Gruszka
Browse files

accel/ivpu: Use generation based function and registers names



Given that VPU generation can be used by multiple platforms, driver should
use VPU IP generation names instead of a platform.

Change naming for functions and registries.

Use 37XX format, where:
  3 - major VPU IP generation version
  7 - minor VPU IP generation version
  XX - postfix indicating this is an architecture and not marketing name

Signed-off-by: default avatarJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Reviewed-by: default avatarJeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230731161258.2987564-3-stanislaw.gruszka@linux.intel.com
parent 864a00b8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -443,8 +443,8 @@ static int ivpu_pci_init(struct ivpu_device *vdev)
	/* Clear any pending errors */
	pcie_capability_clear_word(pdev, PCI_EXP_DEVSTA, 0x3f);

	/* VPU MTL does not require PCI spec 10m D3hot delay */
	if (ivpu_is_mtl(vdev))
	/* VPU 37XX does not require 10m D3hot delay */
	if (ivpu_hw_gen(vdev) == IVPU_HW_37XX)
		pdev->d3hot_delay = 0;

	ret = pcim_enable_device(pdev);
@@ -482,7 +482,7 @@ static int ivpu_dev_init(struct ivpu_device *vdev)
	if (!vdev->pm)
		return -ENOMEM;

	vdev->hw->ops = &ivpu_hw_mtl_ops;
	vdev->hw->ops = &ivpu_hw_37xx_ops;
	vdev->hw->dma_bits = 38;

	vdev->platform = IVPU_PLATFORM_INVALID;
+13 −5
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@

#define PCI_DEVICE_ID_MTL   0x7d1d

#define IVPU_HW_37XX	37

#define IVPU_GLOBAL_CONTEXT_MMU_SSID 0
/* SSID 1 is used by the VPU to represent invalid context */
#define IVPU_USER_CONTEXT_MIN_SSID   2
@@ -146,11 +148,6 @@ void ivpu_file_priv_put(struct ivpu_file_priv **link);
int ivpu_boot(struct ivpu_device *vdev);
int ivpu_shutdown(struct ivpu_device *vdev);

static inline bool ivpu_is_mtl(struct ivpu_device *vdev)
{
	return to_pci_dev(vdev->drm.dev)->device == PCI_DEVICE_ID_MTL;
}

static inline u8 ivpu_revision(struct ivpu_device *vdev)
{
	return to_pci_dev(vdev->drm.dev)->revision;
@@ -161,6 +158,17 @@ static inline u16 ivpu_device_id(struct ivpu_device *vdev)
	return to_pci_dev(vdev->drm.dev)->device;
}

static inline int ivpu_hw_gen(struct ivpu_device *vdev)
{
	switch (ivpu_device_id(vdev)) {
	case PCI_DEVICE_ID_MTL:
		return IVPU_HW_37XX;
	default:
		ivpu_err(vdev, "Unknown VPU device\n");
		return 0;
	}
}

static inline struct ivpu_device *to_ivpu_device(struct drm_device *dev)
{
	return container_of(dev, struct ivpu_device, drm);
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ struct ivpu_hw_info {
	int dma_bits;
};

extern const struct ivpu_hw_ops ivpu_hw_mtl_ops;
extern const struct ivpu_hw_ops ivpu_hw_37xx_ops;

static inline int ivpu_hw_info_init(struct ivpu_device *vdev)
{
+238 −238

File changed.

Preview size limit exceeded, changes collapsed.

+196 −196

File changed.

Preview size limit exceeded, changes collapsed.

Loading