[PATCH 07/10] drm: Store new plane state in a variable for atomic_update and disable
In order to store the new plane state in a subsequent helper, let's move the plane->state dereferences into a variable. This was done using the following coccinelle script, plus some hand changes for vmwgfx: @ plane_atomic_func @ identifier helpers; identifier func; @@ ( static const struct drm_plane_helper_funcs helpers = { ..., .atomic_disable = func, ..., }; | static const struct drm_plane_helper_funcs helpers = { ..., .atomic_update = func, ..., }; ) @ has_new_state_old_state @ identifier plane_atomic_func.func; identifier plane; identifier new_state; symbol old_state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_state) { ... struct drm_plane_state *new_state = plane->state; ... } @ depends on !has_new_state_old_state @ identifier plane_atomic_func.func; identifier plane; symbol old_state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_state) { + struct drm_plane_state *new_state = plane->state; <+... - plane->state + new_state ...+> } @ has_new_state_state @ identifier plane_atomic_func.func; identifier plane; identifier new_state; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *state) { ... struct drm_plane_state *new_state = plane->state; ... } @ depends on !has_new_state_state @ identifier plane_atomic_func.func; identifier plane; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *state) { + struct drm_plane_state *new_plane_state = plane->state; <+... - plane->state + new_plane_state ...+> } @ has_new_state_old_s @ identifier plane_atomic_func.func; identifier plane; identifier new_state; symbol old_s; @@ func(struct drm_plane *plane, struct drm_plane_state *old_s) { ... struct drm_plane_state *new_state = plane->state; ... } @ depends on !has_new_state_old_s @ identifier plane_atomic_func.func; identifier plane; symbol old_s; @@ func(struct drm_plane *plane, struct drm_plane_state *old_s) { + struct drm_plane_state *new_s = plane->state; <+... - plane->state + new_s ...+> } Signed-off-by: Maxime Ripard --- drivers/gpu/drm/arc/arcpgu_crtc.c | 7 ++-- drivers/gpu/drm/arm/hdlcd_crtc.c | 7 ++-- .../gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 5 ++- drivers/gpu/drm/kmb/kmb_plane.c | 19 + drivers/gpu/drm/mediatek/mtk_drm_plane.c | 26 ++-- drivers/gpu/drm/omapdrm/omap_plane.c | 5 ++- drivers/gpu/drm/qxl/qxl_display.c | 20 + drivers/gpu/drm/rcar-du/rcar_du_plane.c | 5 ++- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 3 +- drivers/gpu/drm/sun4i/sun4i_layer.c | 3 +- drivers/gpu/drm/sun4i/sun8i_ui_layer.c| 5 ++- drivers/gpu/drm/sun4i/sun8i_vi_layer.c| 5 ++- drivers/gpu/drm/tegra/dc.c| 42 ++- drivers/gpu/drm/tegra/hub.c | 25 +-- drivers/gpu/drm/vboxvideo/vbox_mode.c | 22 +- drivers/gpu/drm/vkms/vkms_plane.c | 11 ++--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 19 + drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 5 ++- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 7 ++-- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 9 ++-- drivers/gpu/drm/xlnx/zynqmp_disp.c| 7 ++-- drivers/gpu/drm/zte/zx_plane.c| 19 + 22 files changed, 151 insertions(+), 125 deletions(-) diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c index 042d7b54a6de..8907442f473d 100644 --- a/drivers/gpu/drm/arc/arcpgu_crtc.c +++ b/drivers/gpu/drm/arc/arcpgu_crtc.c @@ -147,14 +147,15 @@ static const struct drm_crtc_helper_funcs arc_pgu_crtc_helper_funcs = { static void arc_pgu_plane_atomic_update(struct drm_plane *plane, struct drm_plane_state *state) { + struct drm_plane_state *new_plane_state = plane->state; struct arcpgu_drm_private *arcpgu; struct drm_gem_cma_object *gem; - if (!plane->state->crtc || !plane->state->fb) + if (!new_plane_state->crtc || !new_plane_state->fb) return; - arcpgu = crtc_to_arcpgu_priv(plane->state->crtc); - gem = drm_fb_cma_get_gem_obj(plane->state->fb, 0); + arcpgu = crtc_to_arcpgu_priv(new_plane_state->crtc); + gem = drm_fb_cma_get_gem_obj(new_plane_state->fb, 0); arc_pgu_write(arcpgu, ARCPGU_REG_BUF0_ADDR, gem->paddr); } diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index 028ec39c8484..3f050a52e07a 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -262,7 +262,8 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, static void hdlcd_plane_atomic_update(s
[PATCH 05/10] drm: Use the state pointer directly in planes atomic_check
Now that atomic_check takes the global atomic state as a parameter, we don't need to go through the pointer in the plane state. This was done using the following coccinelle script: @ plane_atomic_func @ identifier helpers; identifier func; @@ static struct drm_plane_helper_funcs helpers = { ..., .atomic_check = func, ..., }; @@ identifier plane_atomic_func.func; identifier plane, state; identifier plane_state; @@ func(struct drm_plane *plane, struct drm_atomic_state *state) { ... - struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane); <... when != plane_state - plane_state->state + state ...> } @@ identifier plane_atomic_func.func; identifier plane, state; identifier plane_state; @@ func(struct drm_plane *plane, struct drm_atomic_state *state) { ... struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane); <... - plane_state->state + state ...> } Signed-off-by: Maxime Ripard --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 2 +- drivers/gpu/drm/arm/hdlcd_crtc.c | 2 +- drivers/gpu/drm/armada/armada_plane.c | 4 ++-- drivers/gpu/drm/ast/ast_mode.c| 4 ++-- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 2 +- drivers/gpu/drm/drm_simple_kms_helper.c | 2 +- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c| 2 +- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 2 +- drivers/gpu/drm/imx/dcss/dcss-plane.c | 2 +- drivers/gpu/drm/imx/ipuv3-plane.c | 2 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 2 +- drivers/gpu/drm/ingenic/ingenic-ipu.c | 2 +- drivers/gpu/drm/kmb/kmb_plane.c | 2 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +- drivers/gpu/drm/meson/meson_overlay.c | 2 +- drivers/gpu/drm/meson/meson_plane.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c| 2 +- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 2 +- drivers/gpu/drm/omapdrm/omap_plane.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +- drivers/gpu/drm/sti/sti_cursor.c | 2 +- drivers/gpu/drm/sti/sti_gdp.c | 2 +- drivers/gpu/drm/sti/sti_hqvdp.c | 2 +- drivers/gpu/drm/sun4i/sun8i_ui_layer.c| 2 +- drivers/gpu/drm/sun4i/sun8i_vi_layer.c| 2 +- drivers/gpu/drm/tidss/tidss_plane.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_plane.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 8 drivers/gpu/drm/virtio/virtgpu_plane.c| 2 +- drivers/gpu/drm/vkms/vkms_plane.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +- drivers/gpu/drm/xlnx/zynqmp_disp.c| 2 +- drivers/gpu/drm/zte/zx_plane.c| 4 ++-- 35 files changed, 41 insertions(+), 41 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 84e35021d9bc..3e056a1fb11a 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6458,7 +6458,7 @@ static int dm_plane_atomic_check(struct drm_plane *plane, return 0; new_crtc_state = - drm_atomic_get_new_crtc_state(new_plane_state->state, + drm_atomic_get_new_crtc_state(state, new_plane_state->crtc); if (!new_crtc_state) return -EINVAL; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c index 2b67b6b9a6b5..4cc4800f0ae5 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c @@ -86,7 +86,7 @@ komeda_plane_atomic_check(struct drm_plane *plane, if (!new_plane_state->crtc || !new_plane_state->fb) return 0; - crtc_st = drm_atomic_get_crtc_state(new_plane_state->state, + crtc_st = drm_atomic_get_crtc_state(state, new_plane_state->crtc); if (IS_ERR(crtc_st) || !crtc_st->enable) { DRM_DEBUG_ATOMIC("Cannot update plane on a disabled CRTC.\n"); diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index 9da9d0581ce9..028ec39c8484 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_crtc.c @@ -244,7 +244,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, return -EINVAL; } - for_each_new_crtc_in_state(new_plane_state->state, crtc, crtc_state, + for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
[PATCH v2 1/3] drm/bridge/lontium-lt9611uxc: fix waiting for EDID to become available
- Call wake_up() when EDID ready event is received to wake wait_event_interruptible_timeout() - Increase waiting timeout, reading EDID can take longer than 100ms, so let's be on a safe side. Signed-off-by: Dmitry Baryshkov Fixes: 0cbbd5b1a012 ("drm: bridge: add support for lontium LT9611UXC bridge") --- drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c index 0c98d27f84ac..a59e811f1705 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c @@ -145,8 +145,10 @@ static irqreturn_t lt9611uxc_irq_thread_handler(int irq, void *dev_id) lt9611uxc_unlock(lt9611uxc); - if (irq_status & BIT(0)) + if (irq_status & BIT(0)) { lt9611uxc->edid_read = !!(hpd_status & BIT(0)); + wake_up_all(<9611uxc->wq); + } if (irq_status & BIT(1)) { if (lt9611uxc->connector.dev) @@ -465,7 +467,7 @@ static enum drm_connector_status lt9611uxc_bridge_detect(struct drm_bridge *brid static int lt9611uxc_wait_for_edid(struct lt9611uxc *lt9611uxc) { return wait_event_interruptible_timeout(lt9611uxc->wq, lt9611uxc->edid_read, - msecs_to_jiffies(100)); + msecs_to_jiffies(500)); } static int lt9611uxc_get_edid_block(void *data, u8 *buf, unsigned int block, size_t len) -- 2.29.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 01/10] drm/atomic: Pass the full state to planes async atomic check and update
The current atomic helpers have either their object state being passed as an argument or the full atomic state. The former is the pattern that was done at first, before switching to the latter for new hooks or when it was needed. Let's start convert all the remaining helpers to provide a consistent interface, starting with the planes atomic_async_check and atomic_async_update. The conversion was done using the coccinelle script below, built tested on all the drivers. @@ identifier plane, plane_state; symbol state; @@ struct drm_plane_helper_funcs { ... int (*atomic_async_check)(struct drm_plane *plane, - struct drm_plane_state *plane_state); + struct drm_atomic_state *state); ... } @@ identifier plane, plane_state; symbol state; @@ struct drm_plane_helper_funcs { ... void (*atomic_async_update)(struct drm_plane *plane, - struct drm_plane_state *plane_state); + struct drm_atomic_state *state); ... } @ plane_atomic_func @ identifier helpers; identifier func; @@ ( static const struct drm_plane_helper_funcs helpers = { ..., .atomic_async_check = func, ..., }; | static const struct drm_plane_helper_funcs helpers = { ..., .atomic_async_update = func, ..., }; ) @@ struct drm_plane_helper_funcs *FUNCS; identifier f; identifier dev; identifier plane, plane_state, state; @@ f(struct drm_device *dev, struct drm_atomic_state *state) { <+... - FUNCS->atomic_async_check(plane, plane_state) + FUNCS->atomic_async_check(plane, state) ...+> } @@ struct drm_plane_helper_funcs *FUNCS; identifier f; identifier dev; identifier plane, plane_state, state; @@ f(struct drm_device *dev, struct drm_atomic_state *state) { <+... - FUNCS->atomic_async_update(plane, plane_state) + FUNCS->atomic_async_update(plane, state) ...+> } @@ identifier mtk_plane_atomic_async_update; identifier plane; symbol new_state, state; expression e; @@ void mtk_plane_atomic_async_update(struct drm_plane *plane, struct drm_plane_state *new_state) { ... - struct mtk_plane_state *state = e; + struct mtk_plane_state *new_plane_state = e; <+... - state + new_plane_state ...+> } @@ identifier plane_atomic_func.func; identifier plane; symbol state; @@ func(struct drm_plane *plane, -struct drm_plane_state *state) +struct drm_plane_state *new_plane_state) { <... - state + new_plane_state ...> } @ ignores_new_state @ identifier plane_atomic_func.func; identifier plane, new_plane_state; @@ func(struct drm_plane *plane, struct drm_plane_state *new_plane_state) { ... when != new_plane_state } @ adds_new_state depends on plane_atomic_func && !ignores_new_state @ identifier plane_atomic_func.func; identifier plane, new_plane_state; @@ func(struct drm_plane *plane, struct drm_plane_state *new_plane_state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); ... } @ depends on plane_atomic_func @ identifier plane_atomic_func.func; identifier plane, plane_state; @@ func(struct drm_plane *plane, - struct drm_plane_state *plane_state + struct drm_atomic_state *state ) { ... } @ include depends on adds_new_state @ @@ #include @ no_include depends on !include && adds_new_state @ @@ + #include #include @@ identifier plane_atomic_func.func; identifier plane, state; identifier plane_state; @@ func(struct drm_plane *plane, struct drm_atomic_state *state) { ... struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane); <+... - plane_state->state + state ...+> } Signed-off-by: Maxime Ripard --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 ++- drivers/gpu/drm/drm_atomic_helper.c | 4 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 26 + drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c| 33 ++- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 16 -- drivers/gpu/drm/vc4/vc4_plane.c | 56 ++- include/drm/drm_modeset_helper_vtables.h | 14 ++--- 7 files changed, 87 insertions(+), 70 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 5675c1f9368a..476bf2e6a4f4 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6475,7 +6475,7 @@ static int dm_plane_atomic_check(struct drm_plane *plane, } static int dm_plane_atomic_async_check(struct drm_plane *plane, - struct drm_plane_state *new_plane_state) + struct drm_atomic_state *state) { /* Only supp
Re: [PATCH][next] drm/amdgpu: Add missing BOOTUP_DEFAULT to profile_name[]
Le 15/01/2021 à 11:10, Colin Ian King a écrit : On 15/01/2021 10:07, Christophe JAILLET wrote: Le 15/01/2021 à 10:37, Colin Ian King a écrit : On 12/01/2021 10:07, Dan Carpenter wrote: On Mon, Jan 11, 2021 at 11:46:38AM +, Colin King wrote: From: Colin Ian King A recent change added a new BOOTUP_DEFAULT power profile mode to the PP_SMC_POWER_PROFILE enum but omitted updating the corresponding profile_name array. Fix this by adding in the missing BOOTUP_DEFAULT to profile_name[]. Still not enough to prevent the array overflow. It needs POWERSAVE as well. Thanks for checking, but there is a 1-to-1 relation ship now: enum PP_SMC_POWER_PROFILE { PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT = 0x0, PP_SMC_POWER_PROFILE_FULLSCREEN3D = 0x1, PP_SMC_POWER_PROFILE_POWERSAVING = 0x2, PP_SMC_POWER_PROFILE_VIDEO = 0x3, PP_SMC_POWER_PROFILE_VR = 0x4, PP_SMC_POWER_PROFILE_COMPUTE = 0x5, PP_SMC_POWER_PROFILE_CUSTOM = 0x6, PP_SMC_POWER_PROFILE_COUNT, }; vs static const char *profile_name[] = { "BOOTUP_DEFAULT", "3D_FULL_SCREEN", "POWER_SAVING", This line has been added yesterday in commit f727ebeb589d. So Dan was right when he sent his patch, but some else fixed it. Ah, my bad for not seeing that. :-/ However, I wonder if this commit is complete. The description of the commit is about 5 modes, but 6 are listed in PP_SMC_POWER_PROFILE. In the hunk: +static struct cmn2asic_mapping vangogh_workload_map[PP_SMC_POWER_PROFILE_COUNT] = { + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_FULLSCREEN3D, WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT), + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VIDEO, WORKLOAD_PPLIB_VIDEO_BIT), + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VR, WORKLOAD_PPLIB_VR_BIT), + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_COMPUTE, WORKLOAD_PPLIB_COMPUTE_BIT), + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_CUSTOM, WORKLOAD_PPLIB_CUSTOM_BIT), +}; It would look logical to have something like: + WORKLOAD_MAP(PP_SMC_POWER_PROFILE_POWERSAVING, WORKLOAD_PPLIB_POWER_SAVING_BIT), Not sure at all if correct. Just my 2c, CJ CJ "VIDEO", "VR", "COMPUTE", "CUSTOM"}; unless I'm missing something because I've not had enough coffee. Colin regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/vc4: Unify PCM card's driver_name
User-space ALSA matches a card's driver name against an internal list of aliases in order to select the correct configuration for the system. When the driver name isn't defined, the match is performed against the card's name. With the introduction of RPi4 we now have two HDMI ports with two distinct audio cards. This is reflected in their names, making them different from previous RPi versions. With this, ALSA ultimately misses the board's configuration on RPi4. In order to avoid this, set "card->driver_name" to "vc4-hdmi" unanimously. Signed-off-by: Nicolas Saenz Julienne Fixes: f437bc1ec731 ("drm/vc4: drv: Support BCM2711") --- drivers/gpu/drm/vc4/vc4_hdmi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 97f368bc1c67..4bdc8e71b5e5 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1404,6 +1404,7 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) card->dai_link = dai_link; card->num_links = 1; card->name = vc4_hdmi->variant->card_name; + card->driver_name = "vc4-hdmi"; card->dev = dev; card->owner = THIS_MODULE; -- 2.29.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 09/10] drm/atomic: Pass the full state to planes atomic disable and update
The current atomic helpers have either their object state being passed as an argument or the full atomic state. The former is the pattern that was done at first, before switching to the latter for new hooks or when it was needed. Let's start convert all the remaining helpers to provide a consistent interface, starting with the planes atomic_update and atomic_disable. The conversion was done using the coccinelle script below, built tested on all the drivers. @@ identifier plane, plane_state; symbol state; @@ struct drm_plane_helper_funcs { ... void (*atomic_update)(struct drm_plane *plane, - struct drm_plane_state *plane_state); + struct drm_atomic_state *state); ... } @@ identifier plane, plane_state; symbol state; @@ struct drm_plane_helper_funcs { ... void (*atomic_disable)(struct drm_plane *plane, - struct drm_plane_state *plane_state); + struct drm_atomic_state *state); ... } @ plane_atomic_func @ identifier helpers; identifier func; @@ ( static const struct drm_plane_helper_funcs helpers = { ..., .atomic_update = func, ..., }; | static const struct drm_plane_helper_funcs helpers = { ..., .atomic_disable = func, ..., }; ) @@ struct drm_plane_helper_funcs *FUNCS; identifier f; identifier crtc_state; identifier plane, plane_state, state; expression e; @@ f(struct drm_crtc_state *crtc_state) { ... struct drm_atomic_state *state = e; <+... ( - FUNCS->atomic_disable(plane, plane_state) + FUNCS->atomic_disable(plane, state) | - FUNCS->atomic_update(plane, plane_state) + FUNCS->atomic_update(plane, state) ) ...+> } @@ identifier plane_atomic_func.func; identifier plane; symbol state; @@ func(struct drm_plane *plane, -struct drm_plane_state *state) +struct drm_plane_state *old_plane_state) { <... - state + old_plane_state ...> } @ ignores_old_state @ identifier plane_atomic_func.func; identifier plane, old_state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_state) { ... when != old_state } @ adds_old_state depends on plane_atomic_func && !ignores_old_state @ identifier plane_atomic_func.func; identifier plane, plane_state; @@ func(struct drm_plane *plane, struct drm_plane_state *plane_state) { + struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane); ... } @ depends on plane_atomic_func @ identifier plane_atomic_func.func; identifier plane, plane_state; @@ func(struct drm_plane *plane, - struct drm_plane_state *plane_state + struct drm_atomic_state *state ) { ... } @ include depends on adds_old_state @ @@ #include @ no_include depends on !include && adds_old_state @ @@ + #include #include @@ identifier plane_atomic_func.func; identifier plane, state; identifier plane_state; @@ func(struct drm_plane *plane, struct drm_atomic_state *state) { ... struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane); <+... - plane_state->state + state ...+> } Signed-off-by: Maxime Ripard --- drivers/gpu/drm/arc/arcpgu_crtc.c | 2 +- .../gpu/drm/arm/display/komeda/komeda_plane.c | 2 +- drivers/gpu/drm/arm/hdlcd_crtc.c | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 6 -- drivers/gpu/drm/armada/armada_overlay.c | 8 ++-- drivers/gpu/drm/armada/armada_plane.c | 8 ++-- drivers/gpu/drm/ast/ast_mode.c| 12 +++ .../gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 6 +++--- drivers/gpu/drm/drm_atomic_helper.c | 8 drivers/gpu/drm/drm_simple_kms_helper.c | 4 +++- drivers/gpu/drm/exynos/exynos_drm_plane.c | 6 -- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 4 ++-- .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c| 2 +- .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 4 ++-- drivers/gpu/drm/imx/dcss/dcss-plane.c | 6 -- drivers/gpu/drm/imx/ipuv3-plane.c | 6 -- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 ++-- drivers/gpu/drm/ingenic/ingenic-ipu.c | 4 ++-- drivers/gpu/drm/kmb/kmb_plane.c | 8 +--- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 ++-- drivers/gpu/drm/mediatek/mtk_drm_crtc.h | 2 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 8 drivers/gpu/drm/meson/meson_overlay.c | 4 ++-- drivers/gpu/drm/meson/meson_plane.c | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 7 +++ drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h | 2 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c| 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
[PATCH v2 3/3] drm/bridge/lontium-lt9611uxc: move HPD notification out of IRQ handler
drm hotplug handling code (drm_client_dev_hotplug()) can wait on mutex, thus delaying further lt9611uxc IRQ events processing. It was observed occasionally during bootups, when drm_client_modeset_probe() was waiting for EDID ready event, which was delayed because IRQ handler was stuck trying to deliver hotplug event. Move hotplug notifications from IRQ handler to separate work to be able to process IRQ events without delays. Signed-off-by: Dmitry Baryshkov Fixes: 0cbbd5b1a012 ("drm: bridge: add support for lontium LT9611UXC bridge") Reviewed-by: Bjorn Andersson --- drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 30 +- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c index b708700e182d..88630bc2921f 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -36,6 +37,7 @@ struct lt9611uxc { struct mutex ocm_lock; struct wait_queue_head wq; + struct work_struct work; struct device_node *dsi0_node; struct device_node *dsi1_node; @@ -52,6 +54,7 @@ struct lt9611uxc { bool hpd_supported; bool edid_read; + bool hdmi_connected; uint8_t fw_version; }; @@ -151,15 +154,26 @@ static irqreturn_t lt9611uxc_irq_thread_handler(int irq, void *dev_id) } if (irq_status & BIT(1)) { - if (lt9611uxc->connector.dev) - drm_kms_helper_hotplug_event(lt9611uxc->connector.dev); - else - drm_bridge_hpd_notify(<9611uxc->bridge, !!(hpd_status & BIT(1))); + lt9611uxc->hdmi_connected = !!(hpd_status & BIT(1)); + schedule_work(<9611uxc->work); } return IRQ_HANDLED; } +void lt9611uxc_hpd_work(struct work_struct *work) +{ + struct lt9611uxc *lt9611uxc = container_of(work, struct lt9611uxc, work); + + if (lt9611uxc->connector.dev) + drm_kms_helper_hotplug_event(lt9611uxc->connector.dev); + else + drm_bridge_hpd_notify(<9611uxc->bridge, + lt9611uxc->hdmi_connected ? + connector_status_connected : + connector_status_disconnected); +} + static void lt9611uxc_reset(struct lt9611uxc *lt9611uxc) { gpiod_set_value_cansleep(lt9611uxc->reset_gpio, 1); @@ -447,7 +461,7 @@ static enum drm_connector_status lt9611uxc_bridge_detect(struct drm_bridge *brid struct lt9611uxc *lt9611uxc = bridge_to_lt9611uxc(bridge); unsigned int reg_val = 0; int ret; - int connected = 1; + bool connected = true; if (lt9611uxc->hpd_supported) { lt9611uxc_lock(lt9611uxc); @@ -457,8 +471,9 @@ static enum drm_connector_status lt9611uxc_bridge_detect(struct drm_bridge *brid if (ret) dev_err(lt9611uxc->dev, "failed to read hpd status: %d\n", ret); else - connected = reg_val & BIT(1); + connected = !!(reg_val & BIT(1)); } + lt9611uxc->hdmi_connected = connected; return connected ? connector_status_connected : connector_status_disconnected; @@ -931,6 +946,8 @@ static int lt9611uxc_probe(struct i2c_client *client, lt9611uxc->fw_version = ret; init_waitqueue_head(<9611uxc->wq); + INIT_WORK(<9611uxc->work, lt9611uxc_hpd_work); + ret = devm_request_threaded_irq(dev, client->irq, NULL, lt9611uxc_irq_thread_handler, IRQF_ONESHOT, "lt9611uxc", lt9611uxc); @@ -967,6 +984,7 @@ static int lt9611uxc_remove(struct i2c_client *client) struct lt9611uxc *lt9611uxc = i2c_get_clientdata(client); disable_irq(client->irq); + flush_scheduled_work(); lt9611uxc_audio_exit(lt9611uxc); drm_bridge_remove(<9611uxc->bridge); -- 2.29.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH][next] drm/amdgpu: Add missing BOOTUP_DEFAULT to profile_name[]
Le 15/01/2021 à 10:37, Colin Ian King a écrit : On 12/01/2021 10:07, Dan Carpenter wrote: On Mon, Jan 11, 2021 at 11:46:38AM +, Colin King wrote: From: Colin Ian King A recent change added a new BOOTUP_DEFAULT power profile mode to the PP_SMC_POWER_PROFILE enum but omitted updating the corresponding profile_name array. Fix this by adding in the missing BOOTUP_DEFAULT to profile_name[]. Still not enough to prevent the array overflow. It needs POWERSAVE as well. Thanks for checking, but there is a 1-to-1 relation ship now: enum PP_SMC_POWER_PROFILE { PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT = 0x0, PP_SMC_POWER_PROFILE_FULLSCREEN3D = 0x1, PP_SMC_POWER_PROFILE_POWERSAVING = 0x2, PP_SMC_POWER_PROFILE_VIDEO= 0x3, PP_SMC_POWER_PROFILE_VR = 0x4, PP_SMC_POWER_PROFILE_COMPUTE = 0x5, PP_SMC_POWER_PROFILE_CUSTOM = 0x6, PP_SMC_POWER_PROFILE_COUNT, }; vs static const char *profile_name[] = { "BOOTUP_DEFAULT", "3D_FULL_SCREEN", "POWER_SAVING", This line has been added yesterday in commit f727ebeb589d. So Dan was right when he sent his patch, but some else fixed it. CJ "VIDEO", "VR", "COMPUTE", "CUSTOM"}; unless I'm missing something because I've not had enough coffee. Colin regards, dan carpenter ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 2/3] drm/bridge/lontium-lt9611uxc: fix get_edid return code
Return NULL pointer from get_edid() callback rather than ERR_PTR() pointer, as DRM code does NULL checks rather than IS_ERR(). Also while we are at it, return NULL if getting EDID timed out. Signed-off-by: Dmitry Baryshkov Fixes: 0cbbd5b1a012 ("drm: bridge: add support for lontium LT9611UXC bridge") --- drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c index a59e811f1705..b708700e182d 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c @@ -505,7 +505,10 @@ static struct edid *lt9611uxc_bridge_get_edid(struct drm_bridge *bridge, ret = lt9611uxc_wait_for_edid(lt9611uxc); if (ret < 0) { dev_err(lt9611uxc->dev, "wait for EDID failed: %d\n", ret); - return ERR_PTR(ret); + return NULL; + } else if (ret == 0) { + dev_err(lt9611uxc->dev, "wait for EDID timeout\n"); + return NULL; } return drm_do_get_edid(connector, lt9611uxc_get_edid_block, lt9611uxc); -- 2.29.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 0/3] drm/bridge/lontium-lt9611uxc: fix handling of EDID/HPD
These three patches provide fixes for HPD handling and EDID readout for Lontium lt9611uxc DSI-to-HDMI bridge driver. Dmitry Baryshkov (3): drm/bridge/lontium-lt9611uxc: fix waiting for EDID to become available drm/bridge/lontium-lt9611uxc: fix get_edid return code drm/bridge/lontium-lt9611uxc: move HPD notification out of IRQ handler drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 41 +++--- 1 file changed, 32 insertions(+), 9 deletions(-) Changes since v1: - Split first patch into two smaller patches - Add Fixes tags ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 06/10] drm: Use state helper instead of plane state pointer in atomic_check
Many drivers reference the plane->state pointer in order to get the current plane state in their atomic_check hook, which would be the old plane state in the global atomic state since _swap_state hasn't happened when atomic_check is run. Use the drm_atomic_get_old_plane_state helper to get that state to make it more obvious. This was made using the coccinelle script below: @ plane_atomic_func @ identifier helpers; identifier func; @@ static struct drm_plane_helper_funcs helpers = { ..., .atomic_check = func, ..., }; @ replaces_old_state @ identifier plane_atomic_func.func; identifier plane, state, plane_state; @@ func(struct drm_plane *plane, struct drm_atomic_state *state) { ... - struct drm_plane_state *plane_state = plane->state; + struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane); ... } @@ identifier plane_atomic_func.func; identifier plane, state, plane_state; @@ func(struct drm_plane *plane, struct drm_atomic_state *state) { struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane); ... - plane->state + plane_state ... } @ adds_old_state @ identifier plane_atomic_func.func; identifier plane, state; @@ func(struct drm_plane *plane, struct drm_atomic_state *state) { + struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane); ... - plane->state + old_plane_state ... } @ include depends on adds_old_state || replaces_old_state @ @@ #include @ no_include depends on !include && (adds_old_state || replaces_old_state) @ @@ + #include #include Signed-off-by: Maxime Ripard --- drivers/gpu/drm/imx/ipuv3-plane.c | 3 ++- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 4 +++- drivers/gpu/drm/tilcdc/tilcdc_plane.c | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index bf8058bb8206..6b49688652f0 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c @@ -348,7 +348,8 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, { struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); - struct drm_plane_state *old_state = plane->state; + struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, + plane); struct drm_crtc_state *crtc_state; struct device *dev = plane->dev->dev; struct drm_framebuffer *fb = new_state->fb; diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c index 4aac6217a5ad..6ce6ce09fecc 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c @@ -406,12 +406,14 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, static int mdp5_plane_atomic_check(struct drm_plane *plane, struct drm_atomic_state *state) { + struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, + plane); struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); struct drm_crtc *crtc; struct drm_crtc_state *crtc_state; - crtc = new_plane_state->crtc ? new_plane_state->crtc : plane->state->crtc; + crtc = new_plane_state->crtc ? new_plane_state->crtc : old_plane_state->crtc; if (!crtc) return 0; diff --git a/drivers/gpu/drm/tilcdc/tilcdc_plane.c b/drivers/gpu/drm/tilcdc/tilcdc_plane.c index ebdd42dcaf82..c86258132432 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_plane.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_plane.c @@ -26,7 +26,8 @@ static int tilcdc_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); struct drm_crtc_state *crtc_state; - struct drm_plane_state *old_state = plane->state; + struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, + plane); unsigned int pitch; if (!new_state->crtc) -- 2.29.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/i915/userptr: detect un-GUP-able pages early
On 1/15/21 4:56 PM, Chris Wilson wrote: > Quoting Jinoh Kang (2021-01-15 16:23:31) >> If GUP-ineligible pages are passed to a GEM userptr object, -EFAULT is >> returned only when the object is actually bound. >> >> The xf86-video-intel userspace driver cannot differentiate this >> condition, and marks the GPU as wedged. > > The idea was to call gem_set_domain on the object to validate the pages > after creation. I only did that for read-only... I did however make mesa > use set-domain for validation. Thanks for the info! > > As a question how are you getting to call userptr on something that > wasn't passed by SHM ipc? Basically XShmAttachFd, which is not exposed on libX11. > >> This not only disables graphics >> acceleration but may also cripple other functions such as VT switch. > > That should be a non-sequitur; certainly VT switch works without ever > using the GPU. Not that VT switch doesn't work; rather, there's some heavy graphic artifacts such as blank rectangles or part of window going completely transparent. I suppose that's another issue. > >> Solve this by "prefaulting" user pages on GEM object creation, testing >> whether all pages are eligible for get_user_pages() in the process. >> On failure, return -EFAULT so that userspace can fallback to software >> blitting. > > See https://patchwork.freedesktop.org/series/33449/ for adding PROBE | > POPULATE flags. > > But we can just use set-domain. So this patch was unnecessary. Thanks for the pointer as to how to patch the userspace. > -Chris > -- Sincerely, Jinoh Kang ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 1/3] drm/bridge/lontium-lt9611uxc: fix waiting for EDID to become available
On Fri 15 Jan 05:02 CST 2021, Dmitry Baryshkov wrote: > - Call wake_up() when EDID ready event is received to wake > wait_event_interruptible_timeout() > > - Increase waiting timeout, reading EDID can take longer than 100ms, so > let's be on a safe side. > Reviewed-by: Bjorn Andersson Regards, Bjorn > Signed-off-by: Dmitry Baryshkov > Fixes: 0cbbd5b1a012 ("drm: bridge: add support for lontium LT9611UXC bridge") > --- > drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > index 0c98d27f84ac..a59e811f1705 100644 > --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > @@ -145,8 +145,10 @@ static irqreturn_t lt9611uxc_irq_thread_handler(int irq, > void *dev_id) > > lt9611uxc_unlock(lt9611uxc); > > - if (irq_status & BIT(0)) > + if (irq_status & BIT(0)) { > lt9611uxc->edid_read = !!(hpd_status & BIT(0)); > + wake_up_all(<9611uxc->wq); > + } > > if (irq_status & BIT(1)) { > if (lt9611uxc->connector.dev) > @@ -465,7 +467,7 @@ static enum drm_connector_status > lt9611uxc_bridge_detect(struct drm_bridge *brid > static int lt9611uxc_wait_for_edid(struct lt9611uxc *lt9611uxc) > { > return wait_event_interruptible_timeout(lt9611uxc->wq, > lt9611uxc->edid_read, > - msecs_to_jiffies(100)); > + msecs_to_jiffies(500)); > } > > static int lt9611uxc_get_edid_block(void *data, u8 *buf, unsigned int block, > size_t len) > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/10] drm: Rename plane atomic_check state names
Hi, On Fri, Jan 15, 2021 at 02:46:36PM +0100, Thomas Zimmermann wrote: > Hi > > Am 15.01.21 um 13:56 schrieb Maxime Ripard: > > diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c > > b/drivers/gpu/drm/imx/ipuv3-plane.c > > index 8a4235d9d9f1..2cb09e9d9306 100644 > > --- a/drivers/gpu/drm/imx/ipuv3-plane.c > > +++ b/drivers/gpu/drm/imx/ipuv3-plane.c > > @@ -344,12 +344,12 @@ static const struct drm_plane_funcs ipu_plane_funcs = > > { > > }; > > static int ipu_plane_atomic_check(struct drm_plane *plane, > > - struct drm_plane_state *state) > > + struct drm_plane_state *new_state) > > It's not 'new_plane_state' ? That function is using old_state for plane->state: > > { > > struct drm_plane_state *old_state = plane->state; Here ^ So it felt more natural to keep the convention in use in that driver Maxime signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH RFC] drm/vc4: hdmi: Avoid ASoC error messages on startup
On Tue, 2020-12-29 at 16:36 +0100, Stefan Wahren wrote: > During startup of Raspberry Pi 4 there seems to be a race between > VC4 probing and Pulseaudio trying to open its PCM device: > > ASoC: error at snd_soc_dai_startup on fef05700.hdmi: -19 > > Avoid these errors by returning EPROBE_DEFER in this situation. > > Signed-off-by: Stefan Wahren > --- Seems reasonable to me: Tested-by: Nicolas Saenz Julienne Reviewed-by: Nicolas Saenz Julienne Regards, Nicolas signature.asc Description: This is a digitally signed message part ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/i915/userptr: detect un-GUP-able pages early
If GUP-ineligible pages are passed to a GEM userptr object, -EFAULT is returned only when the object is actually bound. The xf86-video-intel userspace driver cannot differentiate this condition, and marks the GPU as wedged. This not only disables graphics acceleration but may also cripple other functions such as VT switch. Solve this by "prefaulting" user pages on GEM object creation, testing whether all pages are eligible for get_user_pages() in the process. On failure, return -EFAULT so that userspace can fallback to software blitting. This behavior can be enabled via a new modparam "gem_userptr_prefault", which is false by default. Known use cases: - As a debugging aid, invalid pointers and/or wrong pages passed to userptr could be caught much earlier. - Qubes OS R4.0 uses VM_PFNMAP pages from drivers/xen/privcmd.c, in order to map framebuffers from Xen guest to dom0. These pages are not GUP-able, but they cannot be exposed via DMA-BUF either. Previously this issue had gone somehow undetected, until some patch between v4.14 and v4.19 triggered it. Signed-off-by: Jinoh Kang Cc: Marek Marczykowski-Górecki Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: David Airlie Cc: Daniel Vetter Cc: Chris Wilson Cc: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 35 + drivers/gpu/drm/i915/i915_params.c | 3 ++ drivers/gpu/drm/i915/i915_params.h | 1 + 3 files changed, 39 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c index f2eaed6aca3d..5d653df2f759 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c @@ -712,6 +712,33 @@ static const struct drm_i915_gem_object_ops i915_gem_userptr_ops = { .release = i915_gem_userptr_release, }; +static int i915_gem_userptr_prefault(unsigned long start, +unsigned long nr_pages, +bool readonly) +{ + unsigned int gup_flags = (readonly ? 0 : FOLL_WRITE) | FOLL_NOWAIT; + int err = 0; + + mmap_read_lock(current->mm); + while (nr_pages) { + long ret; + + ret = get_user_pages(start, nr_pages, gup_flags, NULL, NULL); + if (ret < 0) { + err = (int)ret; + break; + } + if (ret == 0) + ret = 1; /* skip this page */ + + start += ret << PAGE_SHIFT; + nr_pages -= ret; + } + mmap_read_unlock(current->mm); + + return err; +} + /* * Creates a new mm object that wraps some normal memory from the process * context - user memory. @@ -796,6 +823,14 @@ i915_gem_userptr_ioctl(struct drm_device *dev, if (!access_ok((char __user *)(unsigned long)args->user_ptr, args->user_size)) return -EFAULT; + if (i915_modparams.gem_userptr_prefault) { + ret = i915_gem_userptr_prefault((unsigned long)args->user_ptr, + args->user_size >> PAGE_SHIFT, + args->flags & I915_USERPTR_READ_ONLY); + if (ret) + return ret; + } + if (args->flags & I915_USERPTR_READ_ONLY) { /* * On almost all of the older hw, we cannot tell the GPU that diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c index 7f139ea4a90b..b5e0a88c059f 100644 --- a/drivers/gpu/drm/i915/i915_params.c +++ b/drivers/gpu/drm/i915/i915_params.c @@ -197,6 +197,9 @@ i915_param_named_unsafe(fake_lmem_start, ulong, 0400, "Fake LMEM start offset (default: 0)"); #endif +i915_param_named(gem_userptr_prefault, bool, 0600, + "Prefault pages when userptr GEM object is created (default: false)"); + static __always_inline void _print_param(struct drm_printer *p, const char *name, const char *type, diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h index 330c03e2b4f7..323f60298b05 100644 --- a/drivers/gpu/drm/i915/i915_params.h +++ b/drivers/gpu/drm/i915/i915_params.h @@ -79,6 +79,7 @@ struct drm_printer; param(bool, disable_display, false, 0400) \ param(bool, verbose_state_checks, true, 0) \ param(bool, nuclear_pageflip, false, 0400) \ + param(bool, gem_userptr_prefault, false, 0600) \ param(bool, enable_dp_mst, true, 0600) \ param(bool, enable_gvt, false, 0400) -- 2.26.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 1/7] dt-bindings: display: mxsfb: Convert binding to YAML
Am 15. Jänner 2021 23:25:14 MEZ schrieb Laurent Pinchart : >Hi Martin, > >On Fri, Jan 15, 2021 at 08:59:18AM +0100, Martin Kepplinger wrote: >> hi Laurent, >> >> Do you mind me adding a DT property in the old format now? If so, I'd >> appreciated an ack in this thread: >> >https://lore.kernel.org/linux-arm-kernel/20201201134638.ga305...@bogon.m.sigxcpu.org/ >> >> If it causes extra work for you and want to resend your series soon, >I'll >> gladly delay them for later. > >I think the conversion ot YAML is ready. I've split it from the rest of >my series, and posted a v3, asking Rob to merge it. Would you mind >rebasing the addition of the new properties on top ? Hi Laurent, thanks for the timely answer. sounds good; I'll rebase. martin ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/i915/userptr: detect un-GUP-able pages early
On 1/15/21 5:07 PM, Chris Wilson wrote: > Quoting Chris Wilson (2021-01-15 16:56:42) >> Quoting Jinoh Kang (2021-01-15 16:23:31) >>> If GUP-ineligible pages are passed to a GEM userptr object, -EFAULT is >>> returned only when the object is actually bound. >>> >>> The xf86-video-intel userspace driver cannot differentiate this >>> condition, and marks the GPU as wedged. >> >> The idea was to call gem_set_domain on the object to validate the pages >> after creation. I only did that for read-only... I did however make mesa >> use set-domain for validation. > > Hmm, I remember a reason why we wanted to be lazy in populating the > pages was that we would often be called to create a map that was never > used. So the additional gup + bind was measurable, and we would rather > just have a probe. > -Chris > try_upload__blt uses the map immediately, so I guess that would be an appropriate place to patch. > Basically XShmAttachFd, which is not exposed on libX11. To clarify: privcmd pages cannot actually be passed by fd, since it's tightly bound with current->mm. There's some sysv shmop hooking hack involved, which is injected in Xorg side. --- Besides, is there an equivalent code path that lets you eagerly *unpin* pages when closing an userptr object without waiting for the worker? This is actually more of a problem in drivers/xen/grant-table.c side, since it hangs the current task until all page refs are released, and it didn't even use ZONE_DEVICE pages until recently (while still not using dev_pagemap_ops::page_free, since the unpopulated-alloc pgmap is not MEMORY_DEVICE_FS_DAX apparently). (You could say that we should switch to DMA-BUF instead and that would be a valid criticism. I'm merely figuring out what the best workaround for the current status quo would be.) I'm using something like the following: --- drivers/gpu/drm/i915/gem/i915_gem_object.c | 8 drivers/gpu/drm/i915/gem/i915_gem_object_types.h | 1 + drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 3 ++- drivers/gpu/drm/i915/i915_params.c | 3 +++ drivers/gpu/drm/i915/i915_params.h | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c index 00d24000b5e8..4352a5788fd8 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c @@ -167,6 +167,14 @@ static void i915_gem_close_object(struct drm_gem_object *gem, struct drm_file *f i915_lut_handle_free(lut); i915_gem_object_put(obj); } + + if (i915_modparams.gem_userptr_close_immediate && + i915_gem_object_type_has(obj, I915_GEM_OBJECT_IMM_RELEASE) && + i915_gem_object_is_shrinkable(obj) && + !atomic_read(&obj->mm.shrink_pin) && + i915_gem_object_unbind(obj, I915_GEM_OBJECT_UNBIND_ACTIVE | + I915_GEM_OBJECT_UNBIND_TEST) == 0) + __i915_gem_object_put_pages(obj); } static void __i915_gem_free_object_rcu(struct rcu_head *head) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object_types.h b/drivers/gpu/drm/i915/gem/i915_gem_object_types.h index e2d9b7e1e152..0ac1dfed0b91 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object_types.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_object_types.h @@ -36,6 +36,7 @@ struct drm_i915_gem_object_ops { #define I915_GEM_OBJECT_IS_PROXY BIT(3) #define I915_GEM_OBJECT_NO_MMAPBIT(4) #define I915_GEM_OBJECT_ASYNC_CANCEL BIT(5) +#define I915_GEM_OBJECT_IMM_RELEASEBIT(7) /* Interface between the GEM object and its backing storage. * get_pages() is called once prior to the use of the associated set diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c index f2eaed6aca3d..baa91daf43a1 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c @@ -705,7 +705,8 @@ static const struct drm_i915_gem_object_ops i915_gem_userptr_ops = { .flags = I915_GEM_OBJECT_HAS_STRUCT_PAGE | I915_GEM_OBJECT_IS_SHRINKABLE | I915_GEM_OBJECT_NO_MMAP | -I915_GEM_OBJECT_ASYNC_CANCEL, +I915_GEM_OBJECT_ASYNC_CANCEL | +I915_GEM_OBJECT_IMM_RELEASE, .get_pages = i915_gem_userptr_get_pages, .put_pages = i915_gem_userptr_put_pages, .dmabuf_export = i915_gem_userptr_dmabuf_export, diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c index 7f139ea4a90b..4d056fd1b6e7 100644 --- a/drivers/gpu/drm/i915/i915_params.c +++ b/drivers/gpu/drm/i915/i915_params.c @@ -197,6 +197,9 @@ i915_param_named_unsafe(fake_lmem_start, ulong, 0400, "Fake LMEM start offset (default: 0)"); #endif +i915_param_named(gem_userptr_close_immediate, bool, 0600, + "Immediately release pages when use
[PATCH v4 2/2] drm/drm_vblank: set the dma-fence timestamp during send_vblank_event
The explicit out-fences in crtc are signaled as part of vblank event, indicating all framebuffers present on the Atomic Commit request are scanned out on the screen. Though the fence signal and the vblank event notification happens at the same time, triggered by the same hardware vsync event, the timestamp set in both are different. With drivers supporting precise vblank timestamp the difference between the two timestamps would be even higher. This might have an impact on use-mode frameworks using these fence timestamps for purposes other than simple buffer usage. For instance, the Android framework [1] uses the retire-fences as an alternative to vblank when frame-updates are in progress. Set the fence timestamp during send vblank event using a new drm_send_event_timestamp_locked variant to avoid discrepancies. [1] https://android.googlesource.com/platform/frameworks/native/+/master/ services/surfaceflinger/Scheduler/Scheduler.cpp#397 Changes in v2: - Use drm_send_event_timestamp_locked to update fence timestamp - add more information to commit text Changes in v3: - use same backend helper function for variants of drm_send_event to avoid code duplications Changes in v4: - remove WARN_ON from drm_send_event_timestamp_locked Signed-off-by: Veera Sundaram Sankaran --- drivers/gpu/drm/drm_file.c | 69 drivers/gpu/drm/drm_vblank.c | 9 +- include/drm/drm_file.h | 3 ++ 3 files changed, 68 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c index 0ac4566..0f77f71 100644 --- a/drivers/gpu/drm/drm_file.c +++ b/drivers/gpu/drm/drm_file.c @@ -775,20 +775,19 @@ void drm_event_cancel_free(struct drm_device *dev, EXPORT_SYMBOL(drm_event_cancel_free); /** - * drm_send_event_locked - send DRM event to file descriptor + * drm_send_event_helper - send DRM event to file descriptor * @dev: DRM device * @e: DRM event to deliver + * @timestamp: timestamp to set for the fence event in kernel's CLOCK_MONOTONIC + * time domain * - * This function sends the event @e, initialized with drm_event_reserve_init(), - * to its associated userspace DRM file. Callers must already hold - * &drm_device.event_lock, see drm_send_event() for the unlocked version. - * - * Note that the core will take care of unlinking and disarming events when the - * corresponding DRM file is closed. Drivers need not worry about whether the - * DRM file for this event still exists and can call this function upon - * completion of the asynchronous work unconditionally. + * This helper function sends the event @e, initialized with + * drm_event_reserve_init(), to its associated userspace DRM file. + * The timestamp variant of dma_fence_signal is used when the caller + * sends a valid timestamp. */ -void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e) +void drm_send_event_helper(struct drm_device *dev, + struct drm_pending_event *e, ktime_t timestamp) { assert_spin_locked(&dev->event_lock); @@ -799,7 +798,10 @@ void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e) } if (e->fence) { - dma_fence_signal(e->fence); + if (timestamp) + dma_fence_signal_timestamp(e->fence, timestamp); + else + dma_fence_signal(e->fence); dma_fence_put(e->fence); } @@ -814,6 +816,49 @@ void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e) wake_up_interruptible_poll(&e->file_priv->event_wait, EPOLLIN | EPOLLRDNORM); } + +/** + * drm_send_event_timestamp_locked - send DRM event to file descriptor + * @dev: DRM device + * @e: DRM event to deliver + * @timestamp: timestamp to set for the fence event in kernel's CLOCK_MONOTONIC + * time domain + * + * This function sends the event @e, initialized with drm_event_reserve_init(), + * to its associated userspace DRM file. Callers must already hold + * &drm_device.event_lock. + * + * Note that the core will take care of unlinking and disarming events when the + * corresponding DRM file is closed. Drivers need not worry about whether the + * DRM file for this event still exists and can call this function upon + * completion of the asynchronous work unconditionally. + */ +void drm_send_event_timestamp_locked(struct drm_device *dev, + struct drm_pending_event *e, ktime_t timestamp) +{ + drm_send_event_helper(dev, e, timestamp); + +} +EXPORT_SYMBOL(drm_send_event_timestamp_locked); + +/** + * drm_send_event_locked - send DRM event to file descriptor + * @dev: DRM device + * @e: DRM event to deliver + * + * This function sends the event @e, initialized with drm_event_reserve_init(), + * to its associated userspace DRM file. Callers must already hold + * &drm_device.event_lock, see drm_send_event() for the unlocked version. + * + * Note t
[PATCH 08/10] drm: Rename plane->state variables in atomic update and disable
Some drivers are storing the plane->state pointer in atomic_update and atomic_disable in a variable simply called state, while the state passed as an argument is called old_state. In order to ease subsequent reworks and to avoid confusing or inconsistent names, let's rename those variables to new_state. This was done using the following coccinelle script, plus some manual changes for mtk and tegra. @ plane_atomic_func @ identifier helpers; identifier func; @@ ( static const struct drm_plane_helper_funcs helpers = { ..., .atomic_disable = func, ..., }; | static const struct drm_plane_helper_funcs helpers = { ..., .atomic_update = func, ..., }; ) @ moves_new_state_old_state @ identifier plane_atomic_func.func; identifier plane; symbol old_state; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_state) { ... - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_state = plane->state; ... } @ depends on moves_new_state_old_state @ identifier plane_atomic_func.func; identifier plane; identifier old_state; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_state) { <... - state + new_state ...> } @ moves_new_state_oldstate @ identifier plane_atomic_func.func; identifier plane; symbol oldstate; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *oldstate) { ... - struct drm_plane_state *state = plane->state; + struct drm_plane_state *newstate = plane->state; ... } @ depends on moves_new_state_oldstate @ identifier plane_atomic_func.func; identifier plane; identifier old_state; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_state) { <... - state + newstate ...> } @ moves_new_state_old_pstate @ identifier plane_atomic_func.func; identifier plane; symbol old_pstate; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_pstate) { ... - struct drm_plane_state *state = plane->state; + struct drm_plane_state *new_pstate = plane->state; ... } @ depends on moves_new_state_old_pstate @ identifier plane_atomic_func.func; identifier plane; identifier old_pstate; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *old_pstate) { <... - state + new_pstate ...> } Signed-off-by: Maxime Ripard --- drivers/gpu/drm/arm/malidp_planes.c | 34 +++--- drivers/gpu/drm/armada/armada_overlay.c | 104 +- drivers/gpu/drm/armada/armada_plane.c | 63 +-- drivers/gpu/drm/ast/ast_mode.c| 14 +-- drivers/gpu/drm/exynos/exynos_drm_plane.c | 6 +- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 10 +- .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c| 12 +- .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 11 +- drivers/gpu/drm/imx/dcss/dcss-plane.c | 25 +++-- drivers/gpu/drm/imx/ipuv3-plane.c | 45 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 16 +-- drivers/gpu/drm/ingenic/ingenic-ipu.c | 34 +++--- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 29 +++-- drivers/gpu/drm/meson/meson_overlay.c | 6 +- drivers/gpu/drm/meson/meson_plane.c | 30 ++--- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 4 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c| 12 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c| 8 +- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 4 +- drivers/gpu/drm/omapdrm/omap_plane.c | 21 ++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 20 ++-- drivers/gpu/drm/sti/sti_cursor.c | 10 +- drivers/gpu/drm/sti/sti_gdp.c | 40 +++ drivers/gpu/drm/sti/sti_hqvdp.c | 40 +++ drivers/gpu/drm/stm/ltdc.c| 28 ++--- drivers/gpu/drm/tegra/dc.c| 20 ++-- drivers/gpu/drm/tegra/hub.c | 10 +- drivers/gpu/drm/tidss/tidss_plane.c | 8 +- drivers/gpu/drm/tilcdc/tilcdc_plane.c | 14 +-- drivers/gpu/drm/zte/zx_plane.c| 8 +- 30 files changed, 347 insertions(+), 339 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index c94c4a96db68..646b27a42452 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -795,9 +795,9 @@ static void malidp_de_plane_update(struct drm_plane *plane, { struct malidp_plane *mp; struct malidp_plane_state *ms = to_malidp_plane_state(plane->state); - struct drm_plane_state *state = plane->state; - u16 pixel_alpha = state->pixel_blend_mode; - u8 plane_alpha = state->alpha >> 8; + struct drm_plane_state *new_state = plane->state; + u16 pixel_alpha = new_state->pixel_blend_mode; +
Re: [PATCH v3 2/2] drm/drm_vblank: set the dma-fence timestamp during send_vblank_event
On 2021-01-15 14:29, John Stultz wrote: On Thu, Jan 14, 2021 at 12:54 PM wrote: On 2021-01-13 18:28, John Stultz wrote: > On Wed, Jan 13, 2021 at 11:52 AM Veera Sundaram Sankaran > wrote: >> >> The explicit out-fences in crtc are signaled as part of vblank event, >> indicating all framebuffers present on the Atomic Commit request are >> scanned out on the screen. Though the fence signal and the vblank >> event >> notification happens at the same time, triggered by the same hardware >> vsync event, the timestamp set in both are different. With drivers >> supporting precise vblank timestamp the difference between the two >> timestamps would be even higher. This might have an impact on use-mode >> frameworks using these fence timestamps for purposes other than simple >> buffer usage. For instance, the Android framework [1] uses the >> retire-fences as an alternative to vblank when frame-updates are in >> progress. Set the fence timestamp during send vblank event using a new >> drm_send_event_timestamp_locked variant to avoid discrepancies. >> >> [1] >> https://android.googlesource.com/platform/frameworks/native/+/master/ >> services/surfaceflinger/Scheduler/Scheduler.cpp#397 >> >> Changes in v2: >> - Use drm_send_event_timestamp_locked to update fence timestamp >> - add more information to commit text >> >> Changes in v3: >> - use same backend helper function for variants of drm_send_event to >> avoid code duplications >> >> Signed-off-by: Veera Sundaram Sankaran >> --- >> drivers/gpu/drm/drm_file.c | 71 >> >> drivers/gpu/drm/drm_vblank.c | 9 +- >> include/drm/drm_file.h | 3 ++ >> 3 files changed, 70 insertions(+), 13 deletions(-) >> >> diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c >> index 0ac4566..b8348ca 100644 >> --- a/drivers/gpu/drm/drm_file.c >> +++ b/drivers/gpu/drm/drm_file.c >> @@ -775,20 +775,19 @@ void drm_event_cancel_free(struct drm_device >> *dev, >> EXPORT_SYMBOL(drm_event_cancel_free); >> >> /** >> - * drm_send_event_locked - send DRM event to file descriptor >> + * drm_send_event_helper - send DRM event to file descriptor >> * @dev: DRM device >> * @e: DRM event to deliver >> + * @timestamp: timestamp to set for the fence event in kernel's >> CLOCK_MONOTONIC >> + * time domain >> * >> - * This function sends the event @e, initialized with >> drm_event_reserve_init(), >> - * to its associated userspace DRM file. Callers must already hold >> - * &drm_device.event_lock, see drm_send_event() for the unlocked >> version. >> - * >> - * Note that the core will take care of unlinking and disarming >> events when the >> - * corresponding DRM file is closed. Drivers need not worry about >> whether the >> - * DRM file for this event still exists and can call this function >> upon >> - * completion of the asynchronous work unconditionally. >> + * This helper function sends the event @e, initialized with >> + * drm_event_reserve_init(), to its associated userspace DRM file. >> + * The timestamp variant of dma_fence_signal is used when the caller >> + * sends a valid timestamp. >> */ >> -void drm_send_event_locked(struct drm_device *dev, struct >> drm_pending_event *e) >> +void drm_send_event_helper(struct drm_device *dev, >> + struct drm_pending_event *e, ktime_t >> timestamp) >> { >> assert_spin_locked(&dev->event_lock); >> >> @@ -799,7 +798,10 @@ void drm_send_event_locked(struct drm_device >> *dev, struct drm_pending_event *e) >> } >> >> if (e->fence) { >> - dma_fence_signal(e->fence); >> + if (timestamp) >> + dma_fence_signal_timestamp(e->fence, >> timestamp); >> + else >> + dma_fence_signal(e->fence); >> dma_fence_put(e->fence); >> } >> >> @@ -814,6 +816,51 @@ void drm_send_event_locked(struct drm_device >> *dev, struct drm_pending_event *e) >> wake_up_interruptible_poll(&e->file_priv->event_wait, >> EPOLLIN | EPOLLRDNORM); >> } >> + >> +/** >> + * drm_send_event_timestamp_locked - send DRM event to file >> descriptor >> + * @dev: DRM device >> + * @e: DRM event to deliver >> + * @timestamp: timestamp to set for the fence event in kernel's >> CLOCK_MONOTONIC >> + * time domain >> + * >> + * This function sends the event @e, initialized with >> drm_event_reserve_init(), >> + * to its associated userspace DRM file. Callers must already hold >> + * &drm_device.event_lock. >> + * >> + * Note that the core will take care of unlinking and disarming >> events when the >> + * corresponding DRM file is closed. Drivers need not worry about >> whether the >> + * DRM file for this event still exists and can call this function >> upon >> + * completion of the asynchronous work unconditionally. >> + */ >> +void drm_send_event_timestamp_locked(struct drm_device *dev, >> + struct drm_pending_event *e, ktime_t >> t
[PATCH] drm/dp_helper: tweak kerneldoc to address warning
Commit 07c9b8634fb6 ("drm/dp_helper: Add helpers to configure PCONs RGB-YCbCr Conversion") introduces a warning with make htmldocs in ./drivers/gpu/drm/drm_dp_helper.c:965 for drm_dp_downstream_rgb_to_ycbcr_conversion(): warning: Excess function parameter 'colorspc' description warning: Function parameter or member 'color_spc' not described Tweak the kerneldoc for drm_dp_downstream_rgb_to_ycbcr_conversion(). Fixes: 07c9b8634fb6 ("drm/dp_helper: Add helpers to configure PCONs RGB-YCbCr Conversion") Signed-off-by: Lukas Bulwahn --- applies cleanly on next-20210115 Jani, please pick this minor doc warning fixup. drivers/gpu/drm/drm_dp_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 3ecde451f523..d60e94ac6fdd 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -954,7 +954,7 @@ EXPORT_SYMBOL(drm_dp_downstream_444_to_420_conversion); * RGB->YCbCr conversion capability * @dpcd: DisplayPort configuration data * @port_cap: downstream facing port capabilities - * @colorspc: Colorspace for which conversion cap is sought + * @color_spc: Colorspace for which conversion cap is sought * * Returns: whether the downstream facing port can convert RGB->YCbCr for a given * colorspace. @@ -3134,7 +3134,7 @@ int drm_dp_pcon_pps_override_param(struct drm_dp_aux *aux, u8 pps_param[6]) } EXPORT_SYMBOL(drm_dp_pcon_pps_override_param); -/* +/** * drm_dp_pcon_convert_rgb_to_ycbcr() - Configure the PCon to convert RGB to Ycbcr * @aux: displayPort AUX channel * @color_spc: Color-space/s for which conversion is to be enabled, 0 for disable. -- 2.17.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 10/10] drm: Use state helper instead of the plane state pointer
Many drivers reference the plane->state pointer in order to get the current plane state in their atomic_update or atomic_disable hooks, which would be the new plane state in the global atomic state since _swap_state happened when those hooks are run. Use the drm_atomic_get_new_plane_state helper to get that state to make it more obvious. This was made using the coccinelle script below: @ plane_atomic_func @ identifier helpers; identifier func; @@ ( static const struct drm_plane_helper_funcs helpers = { ..., .atomic_disable = func, ..., }; | static const struct drm_plane_helper_funcs helpers = { ..., .atomic_update = func, ..., }; ) @ adds_new_state @ identifier plane_atomic_func.func; identifier plane, state; identifier new_state; @@ func(struct drm_plane *plane, struct drm_atomic_state *state) { ... - struct drm_plane_state *new_state = plane->state; + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); ... } @ include depends on adds_new_state @ @@ #include @ no_include depends on !include && adds_new_state @ @@ + #include #include Signed-off-by: Maxime Ripard --- drivers/gpu/drm/arc/arcpgu_crtc.c | 4 +++- drivers/gpu/drm/arm/hdlcd_crtc.c| 3 ++- drivers/gpu/drm/arm/malidp_planes.c | 3 ++- drivers/gpu/drm/armada/armada_overlay.c | 3 ++- drivers/gpu/drm/armada/armada_plane.c | 3 ++- drivers/gpu/drm/ast/ast_mode.c | 6 -- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 3 ++- drivers/gpu/drm/exynos/exynos_drm_plane.c | 3 ++- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 3 ++- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c | 3 ++- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 3 ++- drivers/gpu/drm/imx/dcss/dcss-plane.c | 3 ++- drivers/gpu/drm/imx/ipuv3-plane.c | 3 ++- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 3 ++- drivers/gpu/drm/ingenic/ingenic-ipu.c | 3 ++- drivers/gpu/drm/kmb/kmb_plane.c | 3 ++- drivers/gpu/drm/mediatek/mtk_drm_plane.c| 6 -- drivers/gpu/drm/meson/meson_overlay.c | 3 ++- drivers/gpu/drm/meson/meson_plane.c | 3 ++- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 3 ++- drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c | 4 +++- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 3 ++- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 3 ++- drivers/gpu/drm/omapdrm/omap_plane.c| 6 -- drivers/gpu/drm/qxl/qxl_display.c | 6 -- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 3 ++- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 3 ++- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 3 ++- drivers/gpu/drm/sti/sti_cursor.c| 3 ++- drivers/gpu/drm/sti/sti_gdp.c | 3 ++- drivers/gpu/drm/sti/sti_hqvdp.c | 3 ++- drivers/gpu/drm/stm/ltdc.c | 3 ++- drivers/gpu/drm/sun4i/sun4i_layer.c | 3 ++- drivers/gpu/drm/sun4i/sun8i_ui_layer.c | 3 ++- drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 3 ++- drivers/gpu/drm/tegra/dc.c | 6 -- drivers/gpu/drm/tegra/hub.c | 3 ++- drivers/gpu/drm/tidss/tidss_plane.c | 3 ++- drivers/gpu/drm/tilcdc/tilcdc_plane.c | 3 ++- drivers/gpu/drm/vboxvideo/vbox_mode.c | 6 -- drivers/gpu/drm/vkms/vkms_plane.c | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c| 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c| 3 ++- drivers/gpu/drm/xlnx/zynqmp_disp.c | 3 ++- drivers/gpu/drm/zte/zx_plane.c | 6 -- 46 files changed, 108 insertions(+), 53 deletions(-) diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c b/drivers/gpu/drm/arc/arcpgu_crtc.c index f29ab08550e0..8262ae7ea5e0 100644 --- a/drivers/gpu/drm/arc/arcpgu_crtc.c +++ b/drivers/gpu/drm/arc/arcpgu_crtc.c @@ -5,6 +5,7 @@ * Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com) */ +#include #include #include #include @@ -147,7 +148,8 @@ static const struct drm_crtc_helper_funcs arc_pgu_crtc_helper_funcs = { static void arc_pgu_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_plane_state *new_plane_state = plane->state; + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, + plane); struct arcpgu_drm_private *arcpgu; struct drm_gem_cma_object *gem; diff --git a/drivers/gpu/drm/arm/hdlcd_crtc.c b/drivers/gpu/drm/arm/hdlcd_crtc.c index 2500bf189420..7adb065169e9 100644 --- a/drivers/gpu/drm/arm/hdlcd_crtc.c +++ b/drivers/gpu/drm/arm/hdlcd_cr
Re: [PATCH] drm/hisilicon/hibmc: Remove hibmc_ttm.c
在 2021/1/15 16:42, Thomas Zimmermann 写道: ping for review Am 13.01.21 um 12:31 schrieb Thomas Zimmermann: The file is not in use. It got re-added by a rebased patch. Removing it. Reviewed-by Tian Tao Signed-off-by: Thomas Zimmermann Fixes: 4d4dad21cc7b ("drm/hibmc: Remove references to struct drm_device.pdev") Reported-by: Tian Tao Cc: Sam Ravnborg Cc: Xinliang Liu Cc: Tian Tao Cc: John Stultz Cc: Xinwei Kong Cc: Chen Feng Cc: Daniel Vetter Cc: Gong junjie --- drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 61 - 1 file changed, 61 deletions(-) delete mode 100644 drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c deleted file mode 100644 index 77f075075db2.. --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* Hisilicon Hibmc SoC drm driver - * - * Based on the bochs drm driver. - * - * Copyright (c) 2016 Huawei Limited. - * - * Author: - * Rongrong Zou - * Rongrong Zou - * Jianhua Li - */ - -#include - -#include -#include -#include -#include -#include - -#include "hibmc_drm_drv.h" - -int hibmc_mm_init(struct hibmc_drm_private *hibmc) -{ - struct drm_vram_mm *vmm; - int ret; - struct drm_device *dev = hibmc->dev; - struct pci_dev *pdev = to_pci_dev(dev->dev); - - vmm = drm_vram_helper_alloc_mm(dev, pci_resource_start(pdev, 0), - hibmc->fb_size); - if (IS_ERR(vmm)) { - ret = PTR_ERR(vmm); - drm_err(dev, "Error initializing VRAM MM; %d\n", ret); - return ret; - } - - return 0; -} - -void hibmc_mm_fini(struct hibmc_drm_private *hibmc) -{ - if (!hibmc->dev->vram_mm) - return; - - drm_vram_helper_release_mm(hibmc->dev); -} - -int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev, - struct drm_mode_create_dumb *args) -{ - return drm_gem_vram_fill_create_dumb(file, dev, 0, 128, args); -} - -const struct drm_mode_config_funcs hibmc_mode_funcs = { - .mode_valid = drm_vram_helper_mode_valid, - .atomic_check = drm_atomic_helper_check, - .atomic_commit = drm_atomic_helper_commit, - .fb_create = drm_gem_fb_create, -}; ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 1/5] drm/panel-simple: Undo enable if HPD never asserts
Quoting Douglas Anderson (2021-01-15 14:44:16) > If the HPD signal never asserts in panel_simple_prepare() and we > return an error, we should unset the enable GPIO and disable the > regulator to make it consistent for the caller. > > At the moment I have some hardware where HPD sometimes doesn't assert. > Obviously that needs to be debugged, but this patch makes it so that > if I add a retry that I can make things work. > > Fixes: 48834e6084f1 ("drm/panel-simple: Support hpd-gpios for delaying > prepare()") > Signed-off-by: Douglas Anderson > --- Nice catch on the unprepared_time Reviewed-by: Stephen Boyd ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 04/10] drm/atomic: Pass the full state to planes atomic_check
The current atomic helpers have either their object state being passed as an argument or the full atomic state. The former is the pattern that was done at first, before switching to the latter for new hooks or when it was needed. Let's start convert all the remaining helpers to provide a consistent interface, starting with the planes atomic_check. The conversion was done using the coccinelle script below plus some manual changes for vmwgfx, built tested on all the drivers. @@ identifier plane, plane_state; symbol state; @@ struct drm_plane_helper_funcs { ... int (*atomic_check)(struct drm_plane *plane, - struct drm_plane_state *plane_state); + struct drm_atomic_state *state); ... } @ plane_atomic_func @ identifier helpers; identifier func; @@ static const struct drm_plane_helper_funcs helpers = { ..., .atomic_check = func, ..., }; @@ struct drm_plane_helper_funcs *FUNCS; identifier f; identifier dev; identifier plane, plane_state, state; @@ f(struct drm_device *dev, struct drm_atomic_state *state) { <+... - FUNCS->atomic_check(plane, plane_state) + FUNCS->atomic_check(plane, state) ...+> } @@ identifier plane_atomic_func.func; identifier plane; symbol state; @@ func(struct drm_plane *plane, -struct drm_plane_state *state) +struct drm_plane_state *new_plane_state) { <... - state + new_plane_state ...> } @ ignores_new_state @ identifier plane_atomic_func.func; identifier plane, new_plane_state; @@ func(struct drm_plane *plane, struct drm_plane_state *new_plane_state) { ... when != new_plane_state } @ adds_new_state depends on plane_atomic_func && !ignores_new_state @ identifier plane_atomic_func.func; identifier plane, new_plane_state; @@ func(struct drm_plane *plane, struct drm_plane_state *new_plane_state) { + struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, plane); ... } @ depends on plane_atomic_func @ identifier plane_atomic_func.func; identifier plane, new_plane_state; @@ func(struct drm_plane *plane, - struct drm_plane_state *new_plane_state + struct drm_atomic_state *state ) { ... } @ include depends on adds_new_state @ @@ #include @ no_include depends on !include && adds_new_state @ @@ + #include #include Signed-off-by: Maxime Ripard --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +++- drivers/gpu/drm/arm/display/komeda/komeda_plane.c | 4 +++- drivers/gpu/drm/arm/hdlcd_crtc.c | 4 +++- drivers/gpu/drm/arm/malidp_planes.c | 4 +++- drivers/gpu/drm/armada/armada_plane.c | 4 +++- drivers/gpu/drm/armada/armada_plane.h | 2 +- drivers/gpu/drm/ast/ast_mode.c| 8 ++-- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 3 ++- drivers/gpu/drm/drm_atomic_helper.c | 2 +- drivers/gpu/drm/drm_simple_kms_helper.c | 4 +++- drivers/gpu/drm/exynos/exynos_drm_plane.c | 4 +++- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 5 - drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_de.c| 4 +++- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 4 +++- drivers/gpu/drm/imx/dcss/dcss-plane.c | 4 +++- drivers/gpu/drm/imx/ipuv3-plane.c | 4 +++- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 +++- drivers/gpu/drm/ingenic/ingenic-ipu.c | 4 +++- drivers/gpu/drm/kmb/kmb_plane.c | 4 +++- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 4 +++- drivers/gpu/drm/meson/meson_overlay.c | 4 +++- drivers/gpu/drm/meson/meson_plane.c | 4 +++- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 5 - drivers/gpu/drm/msm/disp/mdp4/mdp4_plane.c| 2 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c| 4 +++- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 4 +++- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 5 - drivers/gpu/drm/omapdrm/omap_plane.c | 4 +++- drivers/gpu/drm/qxl/qxl_display.c | 4 +++- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 4 +++- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 5 - drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 +++- drivers/gpu/drm/sti/sti_cursor.c | 4 +++- drivers/gpu/drm/sti/sti_gdp.c | 4 +++- drivers/gpu/drm/sti/sti_hqvdp.c | 4 +++- drivers/gpu/drm/stm/ltdc.c| 4 +++- drivers/gpu/drm/sun4i/sun8i_ui_layer.c| 4 +++- drivers/gpu/drm/sun4i/sun8i_vi_layer.c| 4 +++- drivers/gpu/drm/tegra/dc.c| 8 ++-- drivers/gpu/drm/tegra/hub.c | 4 +++- drivers/gpu/drm/tidss/tidss_plane.c | 4 +++- drivers/gpu/drm/tilcdc/tilcdc_plane.c | 4 +++- drivers/gpu/drm
[PATCH 02/10] drm: Rename plane atomic_check state names
Most drivers call the argument to the plane atomic_check hook simply state, which is going to conflict with the global atomic state in a later rework. Let's rename it to new_plane_state (or new_state depending on the convention used in the driver). This was done using the coccinelle script below, and built tested: @ plane_atomic_func @ identifier helpers; identifier func; @@ static const struct drm_plane_helper_funcs helpers = { .atomic_check = func, }; @ has_old_state @ identifier plane_atomic_func.func; identifier plane; expression e; symbol old_state; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *state) { ... struct drm_plane_state *old_state = e; ... } @ depends on has_old_state @ identifier plane_atomic_func.func; identifier plane; symbol old_state; @@ func(struct drm_plane *plane, - struct drm_plane_state *state + struct drm_plane_state *new_state ) { <+... - state + new_state ...+> } @ has_state @ identifier plane_atomic_func.func; identifier plane; symbol state; @@ func(struct drm_plane *plane, struct drm_plane_state *state) { ... } @ depends on has_state @ identifier plane_atomic_func.func; identifier plane; symbol old_state; @@ func(struct drm_plane *plane, - struct drm_plane_state *state + struct drm_plane_state *new_plane_state ) { <+... - state + new_plane_state ...+> } Signed-off-by: Maxime Ripard --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 +++--- .../gpu/drm/arm/display/komeda/komeda_plane.c | 11 ++--- drivers/gpu/drm/arm/hdlcd_crtc.c | 18 drivers/gpu/drm/arm/malidp_planes.c | 36 drivers/gpu/drm/armada/armada_plane.c | 41 ++- drivers/gpu/drm/ast/ast_mode.c| 26 ++-- drivers/gpu/drm/exynos/exynos_drm_plane.c | 6 +-- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 6 +-- .../gpu/drm/hisilicon/hibmc/hibmc_drm_de.c| 22 +- .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 24 +-- drivers/gpu/drm/imx/dcss/dcss-plane.c | 26 ++-- drivers/gpu/drm/imx/ipuv3-plane.c | 31 +++--- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 27 ++-- drivers/gpu/drm/ingenic/ingenic-ipu.c | 30 +++--- drivers/gpu/drm/kmb/kmb_plane.c | 22 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 16 drivers/gpu/drm/meson/meson_overlay.c | 10 +++-- drivers/gpu/drm/meson/meson_plane.c | 10 +++-- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 35 drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c| 9 ++-- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 5 ++- drivers/gpu/drm/omapdrm/omap_plane.c | 19 + drivers/gpu/drm/qxl/qxl_display.c | 6 +-- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 7 ++-- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 7 ++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 27 ++-- drivers/gpu/drm/sti/sti_cursor.c | 22 +- drivers/gpu/drm/sti/sti_gdp.c | 26 ++-- drivers/gpu/drm/sti/sti_hqvdp.c | 24 +-- drivers/gpu/drm/stm/ltdc.c| 10 ++--- drivers/gpu/drm/sun4i/sun8i_ui_layer.c| 10 +++-- drivers/gpu/drm/sun4i/sun8i_vi_layer.c| 10 +++-- drivers/gpu/drm/tegra/dc.c| 38 - drivers/gpu/drm/tegra/hub.c | 18 drivers/gpu/drm/tidss/tidss_plane.c | 34 --- drivers/gpu/drm/tilcdc/tilcdc_plane.c | 24 +-- drivers/gpu/drm/vc4/vc4_plane.c | 10 ++--- drivers/gpu/drm/virtio/virtgpu_plane.c| 9 ++-- drivers/gpu/drm/vkms/vkms_plane.c | 11 ++--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 13 +++--- drivers/gpu/drm/xlnx/zynqmp_disp.c| 10 +++-- 41 files changed, 402 insertions(+), 357 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 476bf2e6a4f4..d85336c43e5e 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6439,7 +6439,7 @@ static int dm_plane_helper_check_state(struct drm_plane_state *state, } static int dm_plane_atomic_check(struct drm_plane *plane, -struct drm_plane_state *state) +struct drm_plane_state *new_plane_state) { struct amdgpu_device *adev = drm_to_adev(plane->dev); struct dc *dc = adev->dm.dc; @@ -6448,23 +6448,24 @@ static int dm_plane_atomic_check(struct drm_plane *plane, struct drm_crtc_state *new_crtc_state; int ret; - trace_amdgpu_dm_plane_atomic_check(state); + trace_amdgpu_dm_plane_atom
Re: [PATCH v2 2/3] drm/bridge/lontium-lt9611uxc: fix get_edid return code
On Fri 15 Jan 05:02 CST 2021, Dmitry Baryshkov wrote: > Return NULL pointer from get_edid() callback rather than ERR_PTR() > pointer, as DRM code does NULL checks rather than IS_ERR(). Also while > we are at it, return NULL if getting EDID timed out. > Reviewed-by: Bjorn Andersson > Signed-off-by: Dmitry Baryshkov > Fixes: 0cbbd5b1a012 ("drm: bridge: add support for lontium LT9611UXC bridge") > --- > drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > index a59e811f1705..b708700e182d 100644 > --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c > @@ -505,7 +505,10 @@ static struct edid *lt9611uxc_bridge_get_edid(struct > drm_bridge *bridge, > ret = lt9611uxc_wait_for_edid(lt9611uxc); > if (ret < 0) { > dev_err(lt9611uxc->dev, "wait for EDID failed: %d\n", ret); > - return ERR_PTR(ret); > + return NULL; > + } else if (ret == 0) { > + dev_err(lt9611uxc->dev, "wait for EDID timeout\n"); > + return NULL; > } > > return drm_do_get_edid(connector, lt9611uxc_get_edid_block, lt9611uxc); > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH V4] dt-bindings: gpu: Convert v3d to json-schema
On Wed, 2021-01-13 at 20:08 +0100, Stefan Wahren wrote: > This converts the v3d bindings to yaml format. > > Signed-off-by: Stefan Wahren > --- Reviewed-by: Nicolas Saenz Julienne Regards, Nicolas > > Changes in V4: > - define order for required reg-names > - adapt example > > Changes in V3: > - drop redundant maxItems in case we already have items defined > - fix order of reg-names enum > - tag required items in description > - add reg-names to required properties > - drop clock-names > > .../devicetree/bindings/gpu/brcm,bcm-v3d.txt | 33 -- > .../devicetree/bindings/gpu/brcm,bcm-v3d.yaml | 75 > ++ > 2 files changed, 75 insertions(+), 33 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.txt > create mode 100644 Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.yaml > > diff --git a/Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.txt > b/Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.txt > deleted file mode 100644 > index b2df82b..000 > --- a/Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.txt > +++ /dev/null > @@ -1,33 +0,0 @@ > -Broadcom V3D GPU > - > -Only the Broadcom V3D 3.x and newer GPUs are covered by this binding. > -For V3D 2.x, see brcm,bcm-vc4.txt. > - > -Required properties: > -- compatible:Should be "brcm,7268-v3d" or "brcm,7278-v3d" > -- reg: Physical base addresses and lengths of the register > areas > -- reg-names: Names for the register areas. The "hub" and "core0" > - register areas are always required. The "gca" register area > - is required if the GCA cache controller is present. The > - "bridge" register area is required if an external reset > - controller is not present. > -- interrupts:The interrupt numbers. The first interrupt is for the > hub, > - while the following interrupts are separate interrupt lines > - for the cores (if they don't share the hub's interrupt). > - See bindings/interrupt-controller/interrupts.txt > - > -Optional properties: > -- clocks:The core clock the unit runs on > -- resets:The reset line for v3d, if not using a mapping of the bridge > - See bindings/reset/reset.txt > - > -v3d { > - compatible = "brcm,7268-v3d"; > - reg = <0xf1204000 0x100>, > - <0xf120 0x4000>, > - <0xf1208000 0x4000>, > - <0xf1204100 0x100>; > - reg-names = "bridge", "hub", "core0", "gca"; > - interrupts = <0 78 4>, > - <0 77 4>; > -}; > diff --git a/Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.yaml > b/Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.yaml > new file mode 100644 > index 000..fbce844 > --- /dev/null > +++ b/Documentation/devicetree/bindings/gpu/brcm,bcm-v3d.yaml > @@ -0,0 +1,75 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/gpu/brcm,bcm-v3d.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Broadcom V3D GPU Bindings > + > +maintainers: > + - Eric Anholt > + - Nicolas Saenz Julienne > + > +properties: > + $nodename: > +pattern: '^gpu@[a-f0-9]+$' > + > + compatible: > +enum: > + - brcm,7268-v3d > + - brcm,7278-v3d > + > + reg: > +items: > + - description: hub register (required) > + - description: core0 register (required) > + - description: GCA cache controller register (if GCA controller > present) > + - description: bridge register (if no external reset controller) > +minItems: 2 > + > + reg-names: > +items: > + - const: hub > + - const: core0 > + - enum: [ bridge, gca ] > + - enum: [ bridge, gca ] > +minItems: 2 > +maxItems: 4 > + > + interrupts: > +items: > + - description: hub interrupt (required) > + - description: core interrupts (if it doesn't share the hub's > interrupt) > +minItems: 1 > + > + clocks: > +maxItems: 1 > + > + resets: > +maxItems: 1 > + > + power-domains: > +maxItems: 1 > + > +required: > + - compatible > + - reg > + - reg-names > + - interrupts > + > +additionalProperties: false > + > +examples: > + - | > +gpu@f120 { > + compatible = "brcm,7268-v3d"; > + reg = <0xf120 0x4000>, > +<0xf1208000 0x4000>, > +<0xf1204000 0x100>, > +<0xf1204100 0x100>; > + reg-names = "hub", "core0", "bridge", "gca"; > + interrupts = <0 78 4>, > + <0 77 4>; > +}; > + > +... signature.asc Description: This is a digitally signed message part ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/msm/dpu1: add support for qseed3lite used on sm8250
SM8250 has quite unique qseed lut type: qseed3lite, which is a lightweight version of qseed3 scaler. Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c| 38 +- .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h| 2 + drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c | 1 + drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 1 + drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 73 ++- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h | 3 + drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 1 + 7 files changed, 112 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c index 90393fe9e59c..93c6184903b6 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c @@ -21,6 +21,9 @@ #define VIG_SC7180_MASK \ (VIG_MASK | BIT(DPU_SSPP_SCALER_QSEED4)) +#define VIG_SM8250_MASK \ + (VIG_MASK | BIT(DPU_SSPP_SCALER_QSEED3LITE)) + #define DMA_SDM845_MASK \ (BIT(DPU_SSPP_SRC) | BIT(DPU_SSPP_QOS) | BIT(DPU_SSPP_QOS_8LVL) |\ BIT(DPU_SSPP_TS_PREFILL) | BIT(DPU_SSPP_TS_PREFILL_REC1) |\ @@ -185,7 +188,7 @@ static const struct dpu_caps sm8150_dpu_caps = { static const struct dpu_caps sm8250_dpu_caps = { .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH, .max_mixer_blendstages = 0xb, - .qseed_type = DPU_SSPP_SCALER_QSEED3, /* TODO: qseed3 lite */ + .qseed_type = DPU_SSPP_SCALER_QSEED3LITE, .smart_dma_rev = DPU_SSPP_SMART_DMA_V2, /* TODO: v2.5 */ .ubwc_version = DPU_HW_UBWC_VER_40, .has_src_split = true, @@ -444,6 +447,34 @@ static const struct dpu_sspp_cfg sc7180_sspp[] = { sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_CURSOR1), }; +static const struct dpu_sspp_sub_blks sm8250_vig_sblk_0 = + _VIG_SBLK("0", 5, DPU_SSPP_SCALER_QSEED3LITE); +static const struct dpu_sspp_sub_blks sm8250_vig_sblk_1 = + _VIG_SBLK("1", 6, DPU_SSPP_SCALER_QSEED3LITE); +static const struct dpu_sspp_sub_blks sm8250_vig_sblk_2 = + _VIG_SBLK("2", 7, DPU_SSPP_SCALER_QSEED3LITE); +static const struct dpu_sspp_sub_blks sm8250_vig_sblk_3 = + _VIG_SBLK("3", 8, DPU_SSPP_SCALER_QSEED3LITE); + +static const struct dpu_sspp_cfg sm8250_sspp[] = { + SSPP_BLK("sspp_0", SSPP_VIG0, 0x4000, VIG_SM8250_MASK, + sm8250_vig_sblk_0, 0, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG0), + SSPP_BLK("sspp_1", SSPP_VIG1, 0x6000, VIG_SM8250_MASK, + sm8250_vig_sblk_1, 4, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG1), + SSPP_BLK("sspp_2", SSPP_VIG2, 0x8000, VIG_SM8250_MASK, + sm8250_vig_sblk_2, 8, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG2), + SSPP_BLK("sspp_3", SSPP_VIG3, 0xa000, VIG_SM8250_MASK, + sm8250_vig_sblk_3, 12, SSPP_TYPE_VIG, DPU_CLK_CTRL_VIG3), + SSPP_BLK("sspp_8", SSPP_DMA0, 0x24000, DMA_SDM845_MASK, + sdm845_dma_sblk_0, 1, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA0), + SSPP_BLK("sspp_9", SSPP_DMA1, 0x26000, DMA_SDM845_MASK, + sdm845_dma_sblk_1, 5, SSPP_TYPE_DMA, DPU_CLK_CTRL_DMA1), + SSPP_BLK("sspp_10", SSPP_DMA2, 0x28000, DMA_CURSOR_SDM845_MASK, + sdm845_dma_sblk_2, 9, SSPP_TYPE_DMA, DPU_CLK_CTRL_CURSOR0), + SSPP_BLK("sspp_11", SSPP_DMA3, 0x2a000, DMA_CURSOR_SDM845_MASK, + sdm845_dma_sblk_3, 13, SSPP_TYPE_DMA, DPU_CLK_CTRL_CURSOR1), +}; + /* * MIXER sub blocks config */ @@ -969,9 +1000,8 @@ static void sm8250_cfg_init(struct dpu_mdss_cfg *dpu_cfg) .mdp = sm8250_mdp, .ctl_count = ARRAY_SIZE(sm8150_ctl), .ctl = sm8150_ctl, - /* TODO: sspp qseed version differs from 845 */ - .sspp_count = ARRAY_SIZE(sdm845_sspp), - .sspp = sdm845_sspp, + .sspp_count = ARRAY_SIZE(sm8250_sspp), + .sspp = sm8250_sspp, .mixer_count = ARRAY_SIZE(sm8150_lm), .mixer = sm8150_lm, .dspp_count = ARRAY_SIZE(sm8150_dspp), diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h index eaef99db2d2f..ea4647d21a20 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h @@ -95,6 +95,7 @@ enum { * @DPU_SSPP_SRC Src and fetch part of the pipes, * @DPU_SSPP_SCALER_QSEED2, QSEED2 algorithm support * @DPU_SSPP_SCALER_QSEED3, QSEED3 alogorithm support + * @DPU_SSPP_SCALER_QSEED3LITE, QSEED3 Lite alogorithm support * @DPU_SSPP_SCALER_QSEED4, QSEED4 algorithm support * @DPU_SSPP_SCALER_RGB, RGB Scaler, supported by RGB pipes * @DPU_SSPP_CSC,Support of C
[PATCH 03/10] drm/atmel-hlcdc: Rename custom plane state variable
Subsequent reworks will pass the global atomic state in the function prototype, and atomic_check and atomic_update already have such a variable already. Let's change them to ease the rework. Signed-off-by: Maxime Ripard --- .../gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 118 +- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c index 15bc93163833..c62e930bccad 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c @@ -596,16 +596,16 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, struct drm_plane_state *s) { struct atmel_hlcdc_plane *plane = drm_plane_to_atmel_hlcdc_plane(p); - struct atmel_hlcdc_plane_state *state = + struct atmel_hlcdc_plane_state *hstate = drm_plane_state_to_atmel_hlcdc_plane_state(s); const struct atmel_hlcdc_layer_desc *desc = plane->layer.desc; - struct drm_framebuffer *fb = state->base.fb; + struct drm_framebuffer *fb = hstate->base.fb; const struct drm_display_mode *mode; struct drm_crtc_state *crtc_state; int ret; int i; - if (!state->base.crtc || WARN_ON(!fb)) + if (!hstate->base.crtc || WARN_ON(!fb)) return 0; crtc_state = drm_atomic_get_existing_crtc_state(s->state, s->crtc); @@ -617,94 +617,94 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, if (ret || !s->visible) return ret; - state->src_x = s->src.x1; - state->src_y = s->src.y1; - state->src_w = drm_rect_width(&s->src); - state->src_h = drm_rect_height(&s->src); - state->crtc_x = s->dst.x1; - state->crtc_y = s->dst.y1; - state->crtc_w = drm_rect_width(&s->dst); - state->crtc_h = drm_rect_height(&s->dst); + hstate->src_x = s->src.x1; + hstate->src_y = s->src.y1; + hstate->src_w = drm_rect_width(&s->src); + hstate->src_h = drm_rect_height(&s->src); + hstate->crtc_x = s->dst.x1; + hstate->crtc_y = s->dst.y1; + hstate->crtc_w = drm_rect_width(&s->dst); + hstate->crtc_h = drm_rect_height(&s->dst); - if ((state->src_x | state->src_y | state->src_w | state->src_h) & + if ((hstate->src_x | hstate->src_y | hstate->src_w | hstate->src_h) & SUBPIXEL_MASK) return -EINVAL; - state->src_x >>= 16; - state->src_y >>= 16; - state->src_w >>= 16; - state->src_h >>= 16; + hstate->src_x >>= 16; + hstate->src_y >>= 16; + hstate->src_w >>= 16; + hstate->src_h >>= 16; - state->nplanes = fb->format->num_planes; - if (state->nplanes > ATMEL_HLCDC_LAYER_MAX_PLANES) + hstate->nplanes = fb->format->num_planes; + if (hstate->nplanes > ATMEL_HLCDC_LAYER_MAX_PLANES) return -EINVAL; - for (i = 0; i < state->nplanes; i++) { + for (i = 0; i < hstate->nplanes; i++) { unsigned int offset = 0; int xdiv = i ? fb->format->hsub : 1; int ydiv = i ? fb->format->vsub : 1; - state->bpp[i] = fb->format->cpp[i]; - if (!state->bpp[i]) + hstate->bpp[i] = fb->format->cpp[i]; + if (!hstate->bpp[i]) return -EINVAL; - switch (state->base.rotation & DRM_MODE_ROTATE_MASK) { + switch (hstate->base.rotation & DRM_MODE_ROTATE_MASK) { case DRM_MODE_ROTATE_90: - offset = (state->src_y / ydiv) * + offset = (hstate->src_y / ydiv) * fb->pitches[i]; - offset += ((state->src_x + state->src_w - 1) / - xdiv) * state->bpp[i]; - state->xstride[i] = -(((state->src_h - 1) / ydiv) * + offset += ((hstate->src_x + hstate->src_w - 1) / + xdiv) * hstate->bpp[i]; + hstate->xstride[i] = -(((hstate->src_h - 1) / ydiv) * fb->pitches[i]) - - (2 * state->bpp[i]); - state->pstride[i] = fb->pitches[i] - state->bpp[i]; + (2 * hstate->bpp[i]); + hstate->pstride[i] = fb->pitches[i] - hstate->bpp[i]; break; case DRM_MODE_ROTATE_180: - offset = ((state->src_y + state->src_h - 1) / + offset = ((hstate->src_y + hstate->src_h - 1) / ydiv) * fb->pitches[i]; - offset += ((state->src_x + state->src_w - 1) / - x
[PATCH v4 1/2] dma-fence: allow signaling drivers to set fence timestamp
Some drivers have hardware capability to get the precise HW timestamp of certain events based on which the fences are triggered. The delta between the event HW timestamp & current HW reference timestamp can be used to calculate the timestamp in kernel's CLOCK_MONOTONIC time domain. This allows it to set accurate timestamp factoring out any software and IRQ latencies. Add a timestamp variant of fence signal function, dma_fence_signal_timestamp to allow drivers to update the precise timestamp for fences. Changes in v2: - Add a new fence signal variant instead of modifying fence struct Changes in v3: - Add timestamp domain information to commit-text and dma_fence_signal_timestamp documentation Signed-off-by: Veera Sundaram Sankaran --- drivers/dma-buf/dma-fence.c | 70 - include/linux/dma-fence.h | 3 ++ 2 files changed, 66 insertions(+), 7 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 7475e09..b83e9fa 100644 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -312,22 +312,25 @@ void __dma_fence_might_wait(void) /** - * dma_fence_signal_locked - signal completion of a fence + * dma_fence_signal_timestamp_locked - signal completion of a fence * @fence: the fence to signal + * @timestamp: fence signal timestamp in kernel's CLOCK_MONOTONIC time domain * * Signal completion for software callbacks on a fence, this will unblock * dma_fence_wait() calls and run all the callbacks added with * dma_fence_add_callback(). Can be called multiple times, but since a fence * can only go from the unsignaled to the signaled state and not back, it will - * only be effective the first time. + * only be effective the first time. Set the timestamp provided as the fence + * signal timestamp. * - * Unlike dma_fence_signal(), this function must be called with &dma_fence.lock - * held. + * Unlike dma_fence_signal_timestamp(), this function must be called with + * &dma_fence.lock held. * * Returns 0 on success and a negative error value when @fence has been * signalled already. */ -int dma_fence_signal_locked(struct dma_fence *fence) +int dma_fence_signal_timestamp_locked(struct dma_fence *fence, + ktime_t timestamp) { struct dma_fence_cb *cur, *tmp; struct list_head cb_list; @@ -341,7 +344,7 @@ int dma_fence_signal_locked(struct dma_fence *fence) /* Stash the cb_list before replacing it with the timestamp */ list_replace(&fence->cb_list, &cb_list); - fence->timestamp = ktime_get(); + fence->timestamp = timestamp; set_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags); trace_dma_fence_signaled(fence); @@ -352,6 +355,59 @@ int dma_fence_signal_locked(struct dma_fence *fence) return 0; } +EXPORT_SYMBOL(dma_fence_signal_timestamp_locked); + +/** + * dma_fence_signal_timestamp - signal completion of a fence + * @fence: the fence to signal + * @timestamp: fence signal timestamp in kernel's CLOCK_MONOTONIC time domain + * + * Signal completion for software callbacks on a fence, this will unblock + * dma_fence_wait() calls and run all the callbacks added with + * dma_fence_add_callback(). Can be called multiple times, but since a fence + * can only go from the unsignaled to the signaled state and not back, it will + * only be effective the first time. Set the timestamp provided as the fence + * signal timestamp. + * + * Returns 0 on success and a negative error value when @fence has been + * signalled already. + */ +int dma_fence_signal_timestamp(struct dma_fence *fence, ktime_t timestamp) +{ + unsigned long flags; + int ret; + + if (!fence) + return -EINVAL; + + spin_lock_irqsave(fence->lock, flags); + ret = dma_fence_signal_timestamp_locked(fence, timestamp); + spin_unlock_irqrestore(fence->lock, flags); + + return ret; +} +EXPORT_SYMBOL(dma_fence_signal_timestamp); + +/** + * dma_fence_signal_locked - signal completion of a fence + * @fence: the fence to signal + * + * Signal completion for software callbacks on a fence, this will unblock + * dma_fence_wait() calls and run all the callbacks added with + * dma_fence_add_callback(). Can be called multiple times, but since a fence + * can only go from the unsignaled to the signaled state and not back, it will + * only be effective the first time. + * + * Unlike dma_fence_signal(), this function must be called with &dma_fence.lock + * held. + * + * Returns 0 on success and a negative error value when @fence has been + * signalled already. + */ +int dma_fence_signal_locked(struct dma_fence *fence) +{ + return dma_fence_signal_timestamp_locked(fence, ktime_get()); +} EXPORT_SYMBOL(dma_fence_signal_locked); /** @@ -379,7 +435,7 @@ int dma_fence_signal(struct dma_fence *fence) tmp = dma_fence_begin_signalling(); spin_lock_irqsave(fence->lock, flags); - ret = dma_fence_signal
Re: [PATCH RFC] drm/vc4: hdmi: Avoid ASoC error messages on startup
Hi, On Wed, Jan 13, 2021 at 11:42:23AM +, Mark Brown wrote: > On Wed, Jan 13, 2021 at 10:19:57AM +0100, Maxime Ripard wrote: > > > I'd like to get Mark's opinion before merging though > > I'm not sure what the question is here? I get CCed on a bunch of not > obviously relevant DRM patches so there's a good chance I've just > deleted some relevnat discussion. The patch is question is here: https://lore.kernel.org/dri-devel/1609256210-19863-1-git-send-email-stefan.wah...@i2se.com/ In particular, I'm not so sure whether it's fine to return -EPROBE_DEFER in the startup hook. Thanks! Maxime signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 3/3] drm/bridge/lontium-lt9611uxc: move HPD notification out of IRQ handler
Hi Dmitry, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on drm-intel/for-linux-next] [also build test WARNING on drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next drm-tip/drm-tip linus/master v5.11-rc3 next-20210115] [cannot apply to drm/drm-next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Dmitry-Baryshkov/drm-bridge-lontium-lt9611uxc-fix-handling-of-EDID-HPD/20210116-184620 base: git://anongit.freedesktop.org/drm-intel for-linux-next config: x86_64-randconfig-a004-20210116 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project d7bc3b7ce23b664d6620cdc32370a8614523ca2f) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install x86_64 cross compiling tool for clang build # apt-get install binutils-x86-64-linux-gnu # https://github.com/0day-ci/linux/commit/cfb7e9605e8955217dcee379ef7cd41ebc1d0fad git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Dmitry-Baryshkov/drm-bridge-lontium-lt9611uxc-fix-handling-of-EDID-HPD/20210116-184620 git checkout cfb7e9605e8955217dcee379ef7cd41ebc1d0fad # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/gpu/drm/bridge/lontium-lt9611uxc.c:164:6: warning: no previous >> prototype for function 'lt9611uxc_hpd_work' [-Wmissing-prototypes] void lt9611uxc_hpd_work(struct work_struct *work) ^ drivers/gpu/drm/bridge/lontium-lt9611uxc.c:164:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void lt9611uxc_hpd_work(struct work_struct *work) ^ static 1 warning generated. vim +/lt9611uxc_hpd_work +164 drivers/gpu/drm/bridge/lontium-lt9611uxc.c 163 > 164 void lt9611uxc_hpd_work(struct work_struct *work) 165 { 166 struct lt9611uxc *lt9611uxc = container_of(work, struct lt9611uxc, work); 167 168 if (lt9611uxc->connector.dev) 169 drm_kms_helper_hotplug_event(lt9611uxc->connector.dev); 170 else 171 drm_bridge_hpd_notify(<9611uxc->bridge, 172lt9611uxc->hdmi_connected ? 173connector_status_connected : 174connector_status_disconnected); 175 } 176 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org .config.gz Description: application/gzip ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 3/3] drm/bridge/lontium-lt9611uxc: move HPD notification out of IRQ handler
Hi Dmitry, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on drm-intel/for-linux-next] [also build test WARNING on drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next drm-tip/drm-tip linus/master v5.11-rc3 next-20210115] [cannot apply to drm/drm-next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Dmitry-Baryshkov/drm-bridge-lontium-lt9611uxc-fix-handling-of-EDID-HPD/20210116-184620 base: git://anongit.freedesktop.org/drm-intel for-linux-next config: nds32-randconfig-r033-20210116 (attached as .config) compiler: nds32le-linux-gcc (GCC) 9.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/0day-ci/linux/commit/cfb7e9605e8955217dcee379ef7cd41ebc1d0fad git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Dmitry-Baryshkov/drm-bridge-lontium-lt9611uxc-fix-handling-of-EDID-HPD/20210116-184620 git checkout cfb7e9605e8955217dcee379ef7cd41ebc1d0fad # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/gpu/drm/bridge/lontium-lt9611uxc.c:164:6: warning: no previous >> prototype for 'lt9611uxc_hpd_work' [-Wmissing-prototypes] 164 | void lt9611uxc_hpd_work(struct work_struct *work) | ^~ vim +/lt9611uxc_hpd_work +164 drivers/gpu/drm/bridge/lontium-lt9611uxc.c 163 > 164 void lt9611uxc_hpd_work(struct work_struct *work) 165 { 166 struct lt9611uxc *lt9611uxc = container_of(work, struct lt9611uxc, work); 167 168 if (lt9611uxc->connector.dev) 169 drm_kms_helper_hotplug_event(lt9611uxc->connector.dev); 170 else 171 drm_bridge_hpd_notify(<9611uxc->bridge, 172lt9611uxc->hdmi_connected ? 173connector_status_connected : 174connector_status_disconnected); 175 } 176 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org .config.gz Description: application/gzip ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v1] drm/panel: simple: add SGD GKTW70SDAD1SD
On Sat, Jan 16, 2021 at 9:49 AM Oliver Graute wrote: > > power-supply = <®_touch_3v3> is not correct, as the reg_touch_3v3 > > does not power the LCD. > > yes, but how is the LCD correctly powered then? J4 is powered by VCC_5V and VCC_3V#. > [7.795980] pwm-backlight backlight: supply power not found, using dummy > regulator > [7.804436] OF: /backlight: #pwm-cells = 3 found -1 > [7.806563] of_pwm_get(): can't parse "pwms" property > [7.812026] pwm-backlight backlight: unable to request PWM > [7.822929] pwm-backlight: probe of backlight failed with error -22 You need to fix this. > [7.876831] imx-sdma 20ec000.sdma: Direct firmware load for > imx/sdma/sdma-imx6q.bin failed with error -2 > [7.884231] imx-sdma 20ec000.sdma: Falling back to sysfs fallback for: > imx/sdma/sdma-imx6q.bin > [7.916013] printk: console [ttymxc0] enabled > [7.916013] printk: console [ttymxc0] enabled > [7.922351] printk: bootconsole [ec_imx6q0] disabled > [7.922351] printk: bootconsole [ec_imx6q0] disabled > [7.952397] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 68, base_baud > = 500) is a IMX > [7.970794] 21ec000.serial: ttymxc2 at MMIO 0x21ec000 (irq = 69, base_baud > = 500) is a IMX > [8.033015] [ cut here ] > [8.037826] WARNING: CPU: 0 PID: 1 at > ../drivers/gpu/drm/panel/panel-simple.c:577 panel_simple_probe+0x5dc/0x6b8 And this too > [8.846104] imx6ul-pinctrl 20e.pinctrl: pin MX6UL_PAD_NAND_CE0_B > already requested by regulator-gpio; cannot claim for 1806000.nand-controller > [8.859641] imx6ul-pinctrl 20e.pinctrl: pin-107 > (1806000.nand-controller) status -22 > [8.867851] imx6ul-pinctrl 20e.pinctrl: could not request pin 107 > (MX6UL_PAD_NAND_CE0_B) from group gpminandgrp on device 20e.pinctrl > [8.880930] gpmi-nand 1806000.nand-controller: Error applying setting, > reverse things back > [8.889726] gpmi-nand: probe of 1806000.nand-controller failed with error > -22 And this pin conflict too. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 211189] vgaarb overrides boot device unexpectedly with Intel and discrete AMDGPU
https://bugzilla.kernel.org/show_bug.cgi?id=211189 --- Comment #3 from Dominik Mierzejewski (domi...@greysector.net) --- Created attachment 294673 --> https://bugzilla.kernel.org/attachment.cgi?id=294673&action=edit dmesg from kernel 5.10.7 Thanks for your analysis. Full dmesg attached. -- You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/vc4: Unify PCM card's driver_name
On Fri, 15 Jan 2021 20:12:09 +0100, Nicolas Saenz Julienne wrote: > > User-space ALSA matches a card's driver name against an internal list of > aliases in order to select the correct configuration for the system. > When the driver name isn't defined, the match is performed against the > card's name. > > With the introduction of RPi4 we now have two HDMI ports with two > distinct audio cards. This is reflected in their names, making them > different from previous RPi versions. With this, ALSA ultimately misses > the board's configuration on RPi4. > > In order to avoid this, set "card->driver_name" to "vc4-hdmi" > unanimously. > > Signed-off-by: Nicolas Saenz Julienne > Fixes: f437bc1ec731 ("drm/vc4: drv: Support BCM2711") Looks good to me. Reviewed-by: Takashi Iwai thanks, Takashi > --- > drivers/gpu/drm/vc4/vc4_hdmi.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c > index 97f368bc1c67..4bdc8e71b5e5 100644 > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c > @@ -1404,6 +1404,7 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi > *vc4_hdmi) > card->dai_link = dai_link; > card->num_links = 1; > card->name = vc4_hdmi->variant->card_name; > + card->driver_name = "vc4-hdmi"; > card->dev = dev; > card->owner = THIS_MODULE; > > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel