Commit 9930f518 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-misc-fixes-2023-06-16' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes

drm-misc-fixes maybe in time for v6.4-rc7:
- qaic leak and null deref fix.
- Fix runtime pm in nouveau.
- Fix array overflow in ti-sn65dsi86 pwm chip handling.
- Assorted null check fixes in nouveau.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Maarten Lankhorst <dev@lankhorst.se>
Link: https://patchwork.freedesktop.org/patch/msgid/641eb8a8-fbd7-90ad-0805-310b7fec9344@lankhorst.se
parents c8a5d5ea 55b94bb8
...@@ -97,6 +97,7 @@ static int qaic_open(struct drm_device *dev, struct drm_file *file) ...@@ -97,6 +97,7 @@ static int qaic_open(struct drm_device *dev, struct drm_file *file)
cleanup_usr: cleanup_usr:
cleanup_srcu_struct(&usr->qddev_lock); cleanup_srcu_struct(&usr->qddev_lock);
ida_free(&qaic_usrs, usr->handle);
free_usr: free_usr:
kfree(usr); kfree(usr);
dev_unlock: dev_unlock:
...@@ -224,6 +225,9 @@ static void qaic_destroy_drm_device(struct qaic_device *qdev, s32 partition_id) ...@@ -224,6 +225,9 @@ static void qaic_destroy_drm_device(struct qaic_device *qdev, s32 partition_id)
struct qaic_user *usr; struct qaic_user *usr;
qddev = qdev->qddev; qddev = qdev->qddev;
qdev->qddev = NULL;
if (!qddev)
return;
/* /*
* Existing users get unresolvable errors till they close FDs. * Existing users get unresolvable errors till they close FDs.
......
...@@ -298,6 +298,10 @@ static void ti_sn_bridge_set_refclk_freq(struct ti_sn65dsi86 *pdata) ...@@ -298,6 +298,10 @@ static void ti_sn_bridge_set_refclk_freq(struct ti_sn65dsi86 *pdata)
if (refclk_lut[i] == refclk_rate) if (refclk_lut[i] == refclk_rate)
break; break;
/* avoid buffer overflow and "1" is the default rate in the datasheet. */
if (i >= refclk_lut_size)
i = 1;
regmap_update_bits(pdata->regmap, SN_DPPLL_SRC_REG, REFCLK_FREQ_MASK, regmap_update_bits(pdata->regmap, SN_DPPLL_SRC_REG, REFCLK_FREQ_MASK,
REFCLK_FREQ(i)); REFCLK_FREQ(i));
......
...@@ -220,6 +220,9 @@ static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out ...@@ -220,6 +220,9 @@ static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out
int optimus_funcs; int optimus_funcs;
struct pci_dev *parent_pdev; struct pci_dev *parent_pdev;
if (pdev->vendor != PCI_VENDOR_ID_NVIDIA)
return;
*has_pr3 = false; *has_pr3 = false;
parent_pdev = pci_upstream_bridge(pdev); parent_pdev = pci_upstream_bridge(pdev);
if (parent_pdev) { if (parent_pdev) {
......
...@@ -730,7 +730,8 @@ nouveau_connector_detect_lvds(struct drm_connector *connector, bool force) ...@@ -730,7 +730,8 @@ nouveau_connector_detect_lvds(struct drm_connector *connector, bool force)
#endif #endif
nouveau_connector_set_edid(nv_connector, edid); nouveau_connector_set_edid(nv_connector, edid);
nouveau_connector_set_encoder(connector, nv_encoder); if (nv_encoder)
nouveau_connector_set_encoder(connector, nv_encoder);
return status; return status;
} }
...@@ -966,7 +967,7 @@ nouveau_connector_get_modes(struct drm_connector *connector) ...@@ -966,7 +967,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)
/* Determine display colour depth for everything except LVDS now, /* Determine display colour depth for everything except LVDS now,
* DP requires this before mode_valid() is called. * DP requires this before mode_valid() is called.
*/ */
if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS) if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS && nv_connector->native_mode)
nouveau_connector_detect_depth(connector); nouveau_connector_detect_depth(connector);
/* Find the native mode if this is a digital panel, if we didn't /* Find the native mode if this is a digital panel, if we didn't
...@@ -987,7 +988,7 @@ nouveau_connector_get_modes(struct drm_connector *connector) ...@@ -987,7 +988,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)
* "native" mode as some VBIOS tables require us to use the * "native" mode as some VBIOS tables require us to use the
* pixel clock as part of the lookup... * pixel clock as part of the lookup...
*/ */
if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS) if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS && nv_connector->native_mode)
nouveau_connector_detect_depth(connector); nouveau_connector_detect_depth(connector);
if (nv_encoder->dcb->type == DCB_OUTPUT_TV) if (nv_encoder->dcb->type == DCB_OUTPUT_TV)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment