If we're unable to read the EDID for a display because it's corrupt /
bogus / invalid then we'll add a set of standard modes for the
display. When userspace looks at these modes it doesn't really have a
good concept for which mode to pick and it'll likely pick the highest
resolution one by default. That's probably not ideal because the modes
were purely guesses on the part of the Linux kernel.
Let's instead set 640x480 as the "preferred" mode when we have no EDID.
Signed-off-by: Douglas …
[View More]Anderson <dianders(a)chromium.org>
---
drivers/gpu/drm/drm_edid.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 7a8482b75071..64ccfff4167e 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -5839,6 +5839,15 @@ int drm_add_modes_noedid(struct drm_connector *connector,
continue;
mode = drm_mode_duplicate(dev, ptr);
if (mode) {
+ /*
+ * The drm_dmt_modes array is sorted so that lower
+ * resolutions come first. We'll set the lowest
+ * resolution mode as preferred. We have no EDID so
+ * we should prefer the lowest resolution mode as
+ * the safest one.
+ */
+ if (num_modes == 0)
+ mode->type |= DRM_MODE_TYPE_PREFERRED;
drm_mode_probed_add(connector, mode);
num_modes++;
}
--
2.36.0.rc2.479.g8af0fa9b8e-goog
[View Less]
Hi All,
Fedora has received a bug report here:
https://bugzilla.redhat.com/show_bug.cgi?id=2072556
That Fedora rawhide VMs no longer boot under the VirtualBox hypervisor
after the VM has been updated to a 5.18-rc# kernel.
Switching the emulated GPU from vmwaregfx to VirtualBoxSVGA fixes
this, so this seems to be a vmwgfx driver regression.
Note I've not investigated/reproduced this myself due to -ENOTIME.
Regards,
Hans
Certain DSI bridge chips like TC358767/TC358867/TC9595 expect the DSI D0
data lane to be in LP-11 state when released from reset. Currently the
STM32MP157 DSI host wrapper glue logic keeps D0 data lane in LP-00 state
until DSI init happens, which confuses the TC358767 into entering some
sort of test mode and the chip cannot be brought out of this test mode
in any way.
Enable the wrapper glue logic regulator in probe callback already and
disable it in remove callback to satisfy this requirement.…
[View More] The D0 data
lane is in LP-11 mode when the TC358767 bridge chip is brought up and
the chip is not confused anymore.
Signed-off-by: Marek Vasut <marex(a)denx.de>
Cc: Alexandre Torgue <alexandre.torgue(a)foss.st.com>
Cc: Antonio Borneo <antonio.borneo(a)foss.st.com>
Cc: Philippe Cornu <philippe.cornu(a)foss.st.com>
Cc: Raphael Gallais-Pou <raphael.gallais-pou(a)foss.st.com>
Cc: Robert Foss <robert.foss(a)linaro.org>
Cc: Yannick Fertre <yannick.fertre(a)foss.st.com>
---
drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 30 +++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index 89897d5f5c72..c403633ffeae 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -194,16 +194,29 @@ static int dsi_pll_get_params(struct dw_mipi_dsi_stm *dsi,
return 0;
}
+static int dw_mipi_dsi_phy_regulator_on(struct dw_mipi_dsi_stm *dsi)
+{
+ u32 val;
+
+ /* Enable the regulator */
+ dsi_set(dsi, DSI_WRPCR, WRPCR_REGEN | WRPCR_BGREN);
+ return readl_poll_timeout(dsi->base + DSI_WISR, val, val & WISR_RRS,
+ SLEEP_US, TIMEOUT_US);
+}
+
+static void dw_mipi_dsi_phy_regulator_off(struct dw_mipi_dsi_stm *dsi)
+{
+ /* Disable the regulator */
+ dsi_clear(dsi, DSI_WRPCR, WRPCR_REGEN | WRPCR_BGREN);
+}
+
static int dw_mipi_dsi_phy_init(void *priv_data)
{
struct dw_mipi_dsi_stm *dsi = priv_data;
u32 val;
int ret;
- /* Enable the regulator */
- dsi_set(dsi, DSI_WRPCR, WRPCR_REGEN | WRPCR_BGREN);
- ret = readl_poll_timeout(dsi->base + DSI_WISR, val, val & WISR_RRS,
- SLEEP_US, TIMEOUT_US);
+ ret = dw_mipi_dsi_phy_regulator_on(dsi);
if (ret)
DRM_DEBUG_DRIVER("!TIMEOUT! waiting REGU, let's continue\n");
@@ -499,8 +512,16 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
}
dsi->hw_version = dsi_read(dsi, DSI_VERSION) & VERSION;
+
+ ret = dw_mipi_dsi_phy_regulator_on(dsi);
clk_disable_unprepare(pclk);
+ if (ret) {
+ DRM_ERROR("%s: Failed to enable wrapper regulator, ret=%d\n",
+ __func__, ret);
+ goto err_dsi_probe;
+ }
+
if (dsi->hw_version != HWVER_130 && dsi->hw_version != HWVER_131) {
ret = -ENODEV;
DRM_ERROR("bad dsi hardware version\n");
@@ -542,6 +563,7 @@ static int dw_mipi_dsi_stm_remove(struct platform_device *pdev)
struct dw_mipi_dsi_stm *dsi = platform_get_drvdata(pdev);
dw_mipi_dsi_remove(dsi->dsi);
+ dw_mipi_dsi_phy_regulator_off(dsi);
clk_disable_unprepare(dsi->pllref_clk);
regulator_disable(dsi->vdd_supply);
--
2.35.1
[View Less]
Add the new helpers drm_gem_fb_vmap() and drm_gem_fb_vunmap(), which
provide vmap/vunmap for all BOs of a framebuffer. Convert shadow-
plane helpers, gud and vkms.
Callers of GEM vmap and vunmap functions used to do the minimum work
or get some detail wrong. Therefore shadow-plane helpers were intro-
duced to implement the details for all callers. The vmapping code in
the shadow-plane helpers is also useful for gud and vkms. So it makes
sense to provide rsp helpers. Simply call drm_gem_fb_vmap(…
[View More]) to
retrieve mappings of all of a framebuffer's BOs.
Future work: besides the mapping's addresses, drm_gem_fb_vmap() should
also return the mappings with the framebuffer data offset added. These
are the addresses were the actual image data is located. A follow-up
set of patches will implement this feature.
v3:
* free instances of struct vkms_writeback_job on cleanup
or errors
v2:
* update commit message for first patch (Maxime)
* fix error handling after DRM_FORMAT_MAX_PLANES changes
(kernel test robot)
* fix includes (kernel test robot)
* use [static N] notations for array parameters
Thomas Zimmermann (5):
drm: Define DRM_FORMAT_MAX_PLANES
drm/gem: Provide drm_gem_fb_{vmap,vunmap}()
drm/gem: Clear mapping addresses for unused framebuffer planes
drm/gud: Map framebuffer BOs with drm_gem_fb_vmap()
drm/vkms: Map output framebuffer BOs with drm_gem_fb_vmap()
drivers/gpu/drm/drm_gem_atomic_helper.c | 37 +-------
drivers/gpu/drm/drm_gem_framebuffer_helper.c | 96 ++++++++++++++++++--
drivers/gpu/drm/gud/gud_pipe.c | 10 +-
drivers/gpu/drm/vkms/vkms_composer.c | 2 +-
drivers/gpu/drm/vkms/vkms_drv.h | 6 +-
drivers/gpu/drm/vkms/vkms_writeback.c | 28 +++---
include/drm/drm_fourcc.h | 13 ++-
include/drm/drm_framebuffer.h | 8 +-
include/drm/drm_gem_atomic_helper.h | 3 +-
include/drm/drm_gem_framebuffer_helper.h | 6 ++
10 files changed, 139 insertions(+), 70 deletions(-)
base-commit: 2bda1ca4d4acb4892556fec3a7ea1f02afcd40bb
prerequisite-patch-id: c2b2f08f0eccc9f5df0c0da49fa1d36267deb11d
prerequisite-patch-id: c67e5d886a47b7d0266d81100837557fda34cb24
--
2.32.0
[View Less]
See https://gitlab.freedesktop.org/drm/amd/-/issues/1447
This report was against DRM, but I'm mentioning it here because we've
been talking about some link speed init issues lately, and AFAICT the
gitlab reports don't show up anywhere in lore.
Robert Hancock reported:
> I'm using a RX 5500 XT card on an Asus PRIME H270-PRO motherboard,
> Intel i5-7500 CPU, with kernel 5.10.9 under Fedora 33. I noticed
> that in Linux, "lspci -vv" always showed the GPU PCIe link running
> at 2.5GT/…
[View More]s link speed and never seemed to change regardless of the
> application being run, while in Windows, GPU-Z shows the link
> running at the max supported 8GT/s speed when under graphical load.
>
> It seems like the driver thinks that 2.5GT/s is the max allowable
> speed, based on the pp_dpm_pcie file:
>
> > cd /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:00.0/0000:03:00.0/
> > cat pp_dpm_pcie
> 0: 2.5GT/s, x8 81Mhz *
> 1: 2.5GT/s, x8 619Mhz *
>
> I'm assuming that something is going wrong with the PCIe link speed
> detection in the driver. Using the "amdgpu.pcie_gen_cap=0x70007"
> kernel command line option seems to result in the driver detecting
> the proper 8GT/s maximum speed.
>
> lspci -vv output from booting without overriding the speed is
> attached.
[View Less]
Currently, kernel/module annotates module dependencies when
request_symbol is used, but it doesn't cover more complex inter-driver
dependencies that are subsystem and/or driver-specific.
In the case of hdmi sound, depending on the CPU/GPU, sometimes the
snd_hda_driver can talk directly with the hardware, but sometimes, it
uses the i915 driver. When the snd_hda_driver uses i915, it should
first be unbind/rmmod, as otherwise trying to unbind/rmmod the i915
driver cause driver issues, as as …
[View More]reported by CI tools with different
GPU models:
https://intel-gfx-ci.01.org/tree/drm-tip/IGT_6415/fi-tgl-1115g4/igt@core_ho…https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11495/bat-adlm-1/igt@i915_m…
In the past, just a few CPUs were doing such bindings, but this issue now
applies to all "modern" Intel CPUs that have onboard graphics, as well as
to the newer discrete GPUs.
With the discrete GPU case, the HDA controller is physically separate and
requires i915 to power on the hardware for all hardware access. In this
case, the issue is hit basicly 100% of the time.
With on-board graphics, i915 driver is needed only when the display
codec is accessed. If i915 is unbind during runtime suspend, while
snd-hda-intel is still bound, nothing bad happens, but unbinding i915
on other situations may also cause issues.
So, add support at kernel/modules to allow snd-hda drivers to properly
annotate when a dependency on a DRM driver dependencies exists,
and add a call to such new function at the snd-hda driver when it
successfully binds into the DRM driver.
This would allow userspace tools to check and properly remove the
audio driver before trying to remove or unbind the GPU driver.
It should be noticed that this series conveys the hidden module
dependencies. Other changes are needed in order to allow
removing or unbinding the i915 driver while keeping the snd-hda-intel
driver loaded/bound. With that regards, there are some discussions on
how to improve this at alsa-devel a while back:
https://mailman.alsa-project.org/pipermail/alsa-devel/2021-September/190099…
So, future improvements on both in i915 and the audio drivers could be made.
E.g. with discrete GPUs, it's the only codec of the card, so it seems feasible
to detach the ALSA card if i915 is bound (using infra made for VGA
switcheroo), but, until these improvements are done and land in
upstream, audio drivers needs to be unbound if i915 driver goes unbind.
Yet, even if such fixes got merged, this series is still needed, as it makes
such dependencies more explicit and easier to debug.
PS.: This series was generated against next-20220428.
---
v5:
- while v4 works fine, it ends calling try_module_format() recursively, which
is not what it it was supposed to do. So, change the logic to avoid such
recursion, by adding a static __try_module_format() and renaming the
new version that takes two arguments as try_module_format_owner().
v4:
- fix a compilation warning reported by Intel's Kernel robot when
!CONFIG_MODULE_UNLOAD or !CONFIG_MODULE.
v3: minor fixes:
- fixed a checkpatch warning;
- use a single line for the new function prototype.
v2:
- the dependencies are now handled directly at try_module_get().
Mauro Carvalho Chehab (2):
module: update dependencies at try_module_get()
ALSA: hda - identify when audio is provided by a video driver
include/linux/module.h | 8 +++--
kernel/module/main.c | 65 ++++++++++++++++++++++++++++++--------
sound/hda/hdac_component.c | 2 +-
3 files changed, 57 insertions(+), 18 deletions(-)
--
2.35.1
[View Less]