Ville Syrjälä
e87ba18b4c
drm/i915: Remove pointless dpll_funcs checks
...
All platforms have dpll_funcs. Remove the pointless NULL checks.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-4-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-04-25 21:04:13 +03:00
Ville Syrjälä
8e272b3af3
drm/i915: Pass dev_priv to intel_shared_dpll_init()
...
Stop passing around the drm_device and just pass the
dev_priv instead.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-04-25 21:04:02 +03:00
Ville Syrjälä
9274229af2
drm/i915: Make .get_dplls() return int
...
Get rid of the confusing back and forth between bools and ints
in the .get_dplls() stuff. Just make everything return an int.
Initial conversion done with cocci, with some manual fixups on top:
@find@
identifier func !~ "get_hw_state|_is_|needed";
typedef bool;
parameter list[N] P;
@@
- bool
+ int
func(P)
{
<...
(
- return true;
+ return 0;
|
- return false;
+ return -EINVAL;
)
...>
}
@@
identifier find.func;
expression list[find.N] E;
expression X;
@@
- if (!func(E))
+ ret = func(E);
+ if (ret)
{
...
- return X;
+ return ret;
}
@@
identifier find.func;
expression X;
expression list[find.N] E;
@@
- if (!func(E))
+ ret = func(E);
+ if (ret)
- return X;
+ return ret;
@@
identifier find.func;
expression list[find.N] E;
expression O, X;
typedef bool;
bool B;
@@
- B = func(E);
- if (O && !B)
+ if (O) {
+ ret = func(E);
+ if (ret)
- return X;
+ return ret;
+ }
@@
identifier find.func;
expression list[find.N] E;
expression O, X;
@@
- if (O && !func(E))
+ if (O) {
+ ret = func(E);
+ if (ret)
- return X;
+ return ret;
+ }
@@
identifier find.func;
expression list[find.N] E;
expression X;
typedef bool;
bool B;
@@
- B = func(E);
- if (!B)
+ ret = func(E);
+ if (ret)
{
...
- return X;
+ return ret;
}
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220325123205.22140-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2022-04-25 21:03:15 +03:00
Ville Syrjälä
14eb76f73e
drm/i915/fbc: s/false/0/
...
intel_fbc_check_plane() is supposed to an int, not a boolean.
So replace the bogus 'return false's with the correct 'return 0's.
These were accidental copy-paste mistakes when the code got moved
into intel_fbc_check_plane() from somewhere else tht did return
a boolean.
No functional issue here since false==0.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220413152852.7336-2-ville.syrjala@linux.intel.com
Reviewed-by: Manasi Navare <manasi.d.navare@intel.com >
2022-04-25 18:48:03 +03:00
Ville Syrjälä
3e1faae339
drm/i915/fbc: Consult hw.crtc instead of uapi.crtc
...
plane_state->uapi.crtc is not what we want to be looking at.
If bigjoiner is used hw.crtc is what tells us what crtc the plane
is supposedly using.
Not an actual problem on current hardware as the only FBC capable
pipe (A) can't be a bigjoiner slave and thus uapi.crtc==hw.crtc
always here. But when we get more FBC instances this will become
actually important.
Fixes: 2e6c99f886 ("drm/i915/fbc: Nuke lots of crap from intel_fbc_state_cache")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220413152852.7336-1-ville.syrjala@linux.intel.com
Reviewed-by: Manasi Navare <manasi.d.navare@intel.com >
2022-04-25 18:47:50 +03:00
Imre Deak
af2cbc6ef9
drm/i915: Fix SEL_FETCH_PLANE_*(PIPE_B+) register addresses
...
Fix typo in the _SEL_FETCH_PLANE_BASE_1_B register base address.
Fixes: a5523e2ff0 ("drm/i915: Add PSR2 selective fetch registers")
References: https://gitlab.freedesktop.org/drm/intel/-/issues/5400
Cc: José Roberto de Souza <jose.souza@intel.com >
Cc: <stable@vger.kernel.org > # v5.9+
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: José Roberto de Souza <jose.souza@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220421162221.2261895-1-imre.deak@intel.com
2022-04-25 14:45:33 +03:00
Jani Nikula
1e1d2e1853
Merge tag 'gvt-next-2022-04-21-for-christoph' of https://github.com/intel/gvt-linux into drm-intel-next
...
gvt-next-2022-04-21-for-christoph
- Separating the MMIO table from GVT-g. (Zhi)
- GVT-g re-factor. (Christoph)
- GVT-g mdev API cleanup. (Jason)
- GVT-g trace/makefile cleanup. (Jani)
[Jani: added #include to adapt to header refactoring in drm-intel-next]
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
From: "Wang, Zhi A" <zhi.a.wang@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/25a713cd-0b7d-4c09-7d91-4f4ef6c9eb11@intel.com
2022-04-25 11:20:57 +03:00
Jouni Högander
b4b157577c
drm/i915: Check EDID for HDR static metadata when choosing blc
...
We have now seen panel (XMG Core 15 e21 laptop) advertizing support
for Intel proprietary eDP backlight control via DPCD registers, but
actually working only with legacy pwm control.
This patch adds panel EDID check for possible HDR static metadata and
Intel proprietary eDP backlight control is used only if that exists.
Missing HDR static metadata is ignored if user specifically asks for
Intel proprietary eDP backlight control via enable_dpcd_backlight
parameter.
v2 :
- Ignore missing HDR static metadata if Intel proprietary eDP
backlight control is forced via i915.enable_dpcd_backlight
- Printout info message if panel is missing HDR static metadata and
support for Intel proprietary eDP backlight control is detected
Fixes: 4a8d79901d ("drm/i915/dp: Enable Intel's HDR backlight interface (only SDR for now)")
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5284
Cc: Lyude Paul <lyude@redhat.com >
Cc: Mika Kahola <mika.kahola@intel.com >
Cc: Jani Nikula <jani.nikula@intel.com >
Cc: Filippo Falezza <filippo.falezza@outlook.it >
Cc: stable@vger.kernel.org
Signed-off-by: Jouni Högander <jouni.hogander@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220413082826.120634-1-jouni.hogander@intel.com
Reviewed-by: Lyude Paul <lyude@redhat.com >
2022-04-21 16:57:01 +03:00
Jason Gunthorpe
2917f53113
vfio/mdev: Remove mdev drvdata
...
This is no longer used, remove it.
All usages were moved over to either use container_of() from a vfio_device
or to use dev_drvdata() directly on the mdev.
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-35-hch@lst.de
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Jason Gunthorpe
2aa72ec97c
vfio/mdev: Use the driver core to create the 'remove' file
...
The device creator is supposed to use the dev.groups value to add sysfs
files before device_add is called, not call sysfs_create_files() after
device_add() returns. This creates a race with uevent delivery where the
extra attribute will not be visible.
This was being done because the groups had been co-opted by the mdev
driver, now that prior patches have moved the driver's groups to the
struct device_driver the dev.group is properly free for use here.
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-34-hch@lst.de
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Jason Gunthorpe
6b42f491e1
vfio/mdev: Remove mdev_parent_ops
...
The last useful member in this struct is the supported_type_groups, move
it to the mdev_driver and delete mdev_parent_ops.
Replace it with mdev_driver as an argument to mdev_register_device()
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-33-hch@lst.de
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Jason Gunthorpe
e6486939d8
vfio/mdev: Remove mdev_parent_ops dev_attr_groups
...
This is only used by one sample to print a fixed string that is pointless.
In general, having a device driver attach sysfs attributes to the parent
is horrific. This should never happen, and always leads to some kind of
liftime bug as it become very difficult for the sysfs attribute to go back
to any data owned by the device driver.
Remove the general mechanism to create this abuse.
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-32-hch@lst.de
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Jason Gunthorpe
6c7f98b334
vfio/mdev: Remove vfio_mdev.c
...
Now that all mdev drivers directly create their own mdev_device driver and
directly register with the vfio core's vfio_device_ops this is all dead
code.
Delete vfio_mdev.c and the mdev_parent_ops members that are connected to
it.
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-31-hch@lst.de
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
cba619cb0d
drm/i915/gvt: merge gvt.c into kvmgvt.c
...
The code in both files is deeply interconnected, so merge it and
keep a bunch of structures and functions static.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-30-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
978cf586ac
drm/i915/gvt: convert to use vfio_register_emulated_iommu_dev
...
This is straightforward conversion, the intel_vgpu already has a pointer
to the vfio_dev, which can be replaced with the embedded structure and
we can replace all the mdev_get_drvdata() with a simple container_of().
Based on an patch from Jason Gunthorpe.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-29-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
0e09f4066a
drm/i915/gvt: remove kvmgt_guest_{init,exit}
...
Merge these into their only callers.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-28-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
7f11e6893f
drm/i915/gvt: pass a struct intel_vgpu to the vfio read/write helpers
...
Pass the structure we actually care about instead of deriving it from
the mdev_device in the lower level code.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-27-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
4456641232
drm/i915/gvt: streamline intel_vgpu_create
...
Initialize variables at declaration time, avoid pointless gotos and
cater for the fact that intel_gvt_create_vgpu can't return NULL.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-26-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
37e4bdbd5b
drm/i915/gvt: remove the extra vfio_device refcounting for dmabufs
...
All the dmabufs are torn down when th VGPU is released, so there is
no need for extra refcounting here.
Based on an patch from Jason Gunthorpe.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-25-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
5f8f3fe67c
drm/i915/gvt: remove struct intel_gvt_mpt
...
Just call the initializion and exit functions directly and remove
this abstraction entirely.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-24-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
91879bbaf8
drm/i915/gvt: devirtualize dma_pin_guest_page
...
Just call the function directly and remove a pointless wrapper.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-23-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
8398eee85f
drm/i915/gvt: devirtualize ->dma_{,un}map_guest_page
...
Just call the functions directly. Also remove a pointless wrapper.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-22-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
4c2baaaf76
drm/i915/gvt: devirtualize ->{enable,disable}_page_track
...
Just call the kvmgt functions directly.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-21-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
4050dab598
drm/i915/gvt: devirtualize ->gfn_to_mfn
...
Just open code it in the only caller.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-20-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
bd73b4b193
drm/i915/gvt: devirtualize ->is_valid_gfn
...
Just call the code directly and move towards the callers.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-19-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
b3bece3495
drm/i915/gvt: devirtualize ->inject_msi
...
Just open code the MSI injection in a single place instead of going
through the method table.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-18-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
4c705ad0d7
drm/i915/gvt: devirtualize ->detach_vgpu
...
Just call the function directly.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-17-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
f9399b0e4a
drm/i915/gvt: devirtualize ->set_edid and ->set_opregion
...
Just call the code to setup the opregions and EDID data directly.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-16-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
fe902f0ce6
drm/i915/gvt: devirtualize ->{get,put}_vfio_device
...
Just open code the calls to the VFIO APIs.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-15-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
e3d7640eee
drm/i915/gvt: devirtualize ->{read,write}_gpa
...
Just call the VFIO functions directly instead of through the method
table.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-14-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
3c340d0586
drm/i915/gvt: remove vgpu->handle
...
Always pass the actual vgpu structure instead of encoding it as a
"handle" and add a bool flag to denote if a VGPU is attached.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-13-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
10ddb96295
drm/i915/gvt: merge struct kvmgt_guest_info into strut intel_vgpu
...
Consolidate the per-VGPU structures into a single one.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-12-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
62980cacc3
drm/i915/gvt: merge struct kvmgt_vdev into struct intel_vgpu
...
Move towards having only a single structure for the per-VGPU state.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-11-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
3cbac24c2c
drm/i915/gvt: remove the unused from_virt_to_mfn op
...
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-10-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
c977092a99
drm/i915/gvt: remove the map_gfn_to_mfn and set_trap_area ops
...
The map_gfn_to_mfn and set_trap_area ops are never defined, so remove
them and clean up code that depends on them in the callers.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-9-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
675e5c4a33
drm/i915/gvt: remove intel_gvt_ops
...
Remove these pointless indirect alls by just calling the only instance
of each method directly.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-8-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
8b750bf744
drm/i915/gvt: move the gvt code into kvmgt.ko
...
Instead of having an option to build the gvt code into the main i915
module, just move it into the kvmgt.ko module. This only requires
a new struct with three entries that the KVMGT modules needs to register
with the main i915 module, and a proper list of GVT-enabled devices
instead of global device pointer.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-7-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
f49fc35799
drm/i915/gvt: rename intel_vgpu_ops to intel_vgpu_mdev_ops
...
Free the intel_vgpu_ops symbol name for something that fits better.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-4-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
367748066e
drm/i915/gvt: remove enum hypervisor_type
...
The only supported hypervisor is KVM, so don't bother with dead code
enumerating hypervisors.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-3-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Christoph Hellwig
a85749e12d
drm/i915/gvt: remove module refcounting in intel_gvt_{,un}register_hypervisor
...
THIS_MODULE always is reference when a symbol called by it is used, so
don't bother with the additional reference.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220411141403.86980-2-hch@lst.de
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com >
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
2022-04-21 07:36:56 -04:00
Jani Nikula
7f0cf30187
drm/i915/gvt: better align the Makefile with i915 Makefile
...
Drop extra ccflags, drop extra intermediate variables, list object files
one per line alphabetically.
Cc: Zhi Wang <zhi.wang.linux@gmail.com >
Cc: Christoph Hellwig <hch@lst.de >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/8bc0895376c077156a671e24ac6a5c75b7db4c9c.1649852517.git.jani.nikula@intel.com
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
Reviewed-by: Christoph Hellwig <hch@lst.de >
2022-04-21 07:36:56 -04:00
Jani Nikula
de5d437ae8
drm/i915/gvt: fix trace TRACE_INCLUDE_PATH
...
TRACE_INCLUDE_PATH should be a path relative to define_trace.h, not the
file including it. (See the comment in include/trace/define_trace.h.)
Cc: Zhi Wang <zhi.wang.linux@gmail.com >
Cc: Christoph Hellwig <hch@lst.de >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/48b772795b7ab674f609ecad53b4882c66a8262a.1649852517.git.jani.nikula@intel.com
Reviewed-by: Zhi Wang <zhi.a.wang@intel.com >
Reviewed-by: Christoph Hellwig <hch@lst.de >
2022-04-21 07:36:56 -04:00
Zhi Wang
1672991412
i915/gvt: Use the initial HW state snapshot saved in i915
...
The code of saving initial HW state snapshot has been moved into i915.
Let the GVT-g core logic use that snapshot.
Cc: Christoph Hellwig <hch@lst.de >
Cc: Jason Gunthorpe <jgg@nvidia.com >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Vivi Rodrigo <rodrigo.vivi@intel.com >
Cc: Zhenyu Wang <zhenyuw@linux.intel.com >
Cc: Zhi Wang <zhi.a.wang@intel.com >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Reviewed-by: Christoph Hellwig <hch@lst.de >
Tested-by: Christoph Hellwig <hch@lst.de >
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220407071945.72148-4-zhi.a.wang@intel.com
2022-04-21 07:36:56 -04:00
Zhi Wang
66e7a80633
i915/gvt: Save the initial HW state snapshot in i915
...
Save the initial HW state snapshot in i915 so that the rest code of GVT-g
can be moved into a dedicated module while it can still get a clean
initial HW state saved at the correct time during the initialization of
i915. The futhrer vGPU created by GVT-g will use this HW state as the
initial HW state.
v6:
- Remove the reference of intel_gvt_device_info.(Christoph)
- Refine the save_mmio() function. (Christoph)
Cc: Christoph Hellwig <hch@lst.de >
Cc: Jason Gunthorpe <jgg@nvidia.com >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Vivi Rodrigo <rodrigo.vivi@intel.com >
Cc: Zhenyu Wang <zhenyuw@linux.intel.com >
Cc: Zhi Wang <zhi.a.wang@intel.com >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Reviewed-by: Christoph Hellwig <hch@lst.de >
Tested-by: Christoph Hellwig <hch@lst.de >
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220407071945.72148-3-zhi.a.wang@intel.com
2022-04-21 07:36:56 -04:00
Zhi Wang
e0f74ed463
i915/gvt: Separate the MMIO tracking table from GVT-g
...
To support the new mdev interfaces and the re-factor patches from
Christoph, which moves the GVT-g code into a dedicated module, the GVT-g
MMIO tracking table needs to be separated from GVT-g.
v9:
- Fix a problem might cause kernel panic.
- Remove the redaundant definitation of intel_get_device_type(). (Jani)
- Sort the list of header reference in intel_gvt_mmio.c (Jani)
- Include minimum header insted in intel_gvt_mmio.c (Jani)
v8:
- Use SPDX header in the intel_gvt_mmio_table.c
- Reference the gvt.h with path. (Jani)
- Add a missing fix on mmio emulation path during the debug.
- Fix a building problem on refreshed gvt-staging branch. (Christoph)
v7:
- Keep the marcos of device generation in GVT-g. (Christoph, Jani)
v6:
- Move the mmio_table.c into i915. (Christoph)
- Keep init_device_info and related structures in GVT-g. (Christoph)
- Refine the callbacks of the iterator. (Christoph)
- Move the flags of MMIO register defination to GVT-g. (Chrsitoph)
- Move the mmio block handling to GVT-g.
v5:
- Re-design the mmio table framework. (Christoph)
v4:
- Fix the errors of patch checking scripts.
v3:
- Fix the errors when CONFIG_DRM_I915_WERROR is turned on. (Jani)
v2:
- Implement a mmio table instead of generating it by marco in i915. (Jani)
Cc: Christoph Hellwig <hch@lst.de >
Cc: Jason Gunthorpe <jgg@nvidia.com >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Vivi Rodrigo <rodrigo.vivi@intel.com >
Cc: Zhenyu Wang <zhenyuw@linux.intel.com >
Cc: Zhi Wang <zhi.a.wang@intel.com >
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com >
Reviewed-by: Christoph Hellwig <hch@lst.de >
Tested-by: Christoph Hellwig <hch@lst.de >
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20220407071945.72148-2-zhi.a.wang@intel.com
2022-04-21 07:36:54 -04:00
Imre Deak
f5b2cd89d5
drm/i915: Fixup merge of the power well refactor patchset
...
The wrong v2 version of
drm/i915: Move per-platform power well hooks to intel_display_power_well.c
patch was pushed to drm-intel-next branch instead of v3, fix this up
applying the difference between v2 and v3.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Jouni Högander <jouni.hogander@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220415082524.1826924-1-imre.deak@intel.com
2022-04-20 21:11:41 +03:00
Imre Deak
799da9837d
drm/i915: Remove the XELPD specific AUX and DDI power domains
...
The spec calls the XELPD_D/E ports just D/E, the platform prefix in the
domain names was only needed by the port->domain mapping relying on
matching enum values for the whole port/domain range (and the
corresponding aliasing between the platform specific domain enums).
Since a previous patch we can define the port->domain mapping explicitly
so do this by reusing the already existing D/E power domain names.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Jouni Högander <jouni.hogander@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-18-imre.deak@intel.com
2022-04-20 20:42:13 +03:00
Imre Deak
2431f38c17
drm/i915: Remove duplicate DDI/AUX power domain mappings
...
The DDI and AUX domain -> power well mappings are identical for a few
platforms/power well instances, reuse the mappings of earlier platforms
for these removing the duplicate mapping of new platforms.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Jouni Högander <jouni.hogander@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-17-imre.deak@intel.com
2022-04-20 20:42:13 +03:00
Imre Deak
e20b77c14b
drm/i915: Remove the ICL specific TBT power domains
...
The spec calls the ICL TBT AUX power well instances TBT1-4 (similarly to
all later platforms), align the power domain names with the spec.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Jouni Högander <jouni.hogander@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-16-imre.deak@intel.com
2022-04-20 20:42:13 +03:00
Imre Deak
c97bbab02a
drm/i915: Remove the aliasing of power domain enum values
...
Aliasing the intel_display_power_domain enum values was required because
of the u64 power domain mask size limit. This makes the dmesg/debugfs
printouts of the domain names somewhat unclear, for instance domain
names for port D are shown on D12+ platforms where the corresponding
port is called TC1. Make this clearer by removing the aliasing which is
possible after a previous patch converting the mask to a bitmap.
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Jouni Högander <jouni.hogander@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220414210657.1785773-15-imre.deak@intel.com
2022-04-20 20:42:12 +03:00