[PATCH] drm/tegra: dc: Restore coupling of display controllers
From: Thierry Reding Coupling of display controllers used to rely on runtime PM to take the companion controller out of reset. Commit fd67e9c6ed5a ("drm/tegra: Do not implement runtime PM") accidentally broke this when runtime PM was removed. Restore this functionality by reusing the hierarchical host1x client suspend/resume infrastructure that's similar to runtime PM and which perfectly fits this use-case. Fixes: fd67e9c6ed5a ("drm/tegra: Do not implement runtime PM") Reported-by: Dmitry Osipenko Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/dc.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index 795b4e457ab6..2585ba70b706 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -2519,22 +2519,18 @@ static int tegra_dc_couple(struct tegra_dc *dc) * POWER_CONTROL registers during CRTC enabling. */ if (dc->soc->coupled_pm && dc->pipe == 1) { - u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER; - struct device_link *link; - struct device *partner; + struct device *companion; + struct tegra_dc *parent; - partner = driver_find_device(dc->dev->driver, NULL, NULL, -tegra_dc_match_by_pipe); - if (!partner) + companion = driver_find_device(dc->dev->driver, NULL, (const void *)0, + tegra_dc_match_by_pipe); + if (!companion) return -EPROBE_DEFER; - link = device_link_add(dc->dev, partner, flags); - if (!link) { - dev_err(dc->dev, "failed to link controllers\n"); - return -EINVAL; - } + parent = dev_get_drvdata(companion); + dc->client.parent = &parent->client; - dev_dbg(dc->dev, "coupled to %s\n", dev_name(partner)); + dev_dbg(dc->dev, "coupled to %s\n", dev_name(companion)); } return 0; -- 2.30.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/amd/display: Set AMDGPU_DM_DEFAULT_MIN_BACKLIGHT to 0
AMDGPU_DM_DEFAULT_MIN_BACKLIGHT was set to the value of 12 to ensure no display backlight will flicker at low user brightness settings. However this value is quite bright, so for devices that do not implement the ACPI ATIF ATIF_FUNCTION_QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS functionality the user cannot set the brightness to a low level even if the display would support such a low PWM. This ATIF feature is not implemented on for example AMD grunt chromebooks. Signed-off-by: Evan Benn --- I could not find a justification for the reason for the value. It has caused some noticable regression for users: https://bugzilla.kernel.org/show_bug.cgi?id=203439 Maybe this can be either user controlled or userspace configured, but preventing users from turning their backlight dim seems wrong. Also reviewed here: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2748377 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 573cf17262da..0129bd69b94e 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -3151,7 +3151,7 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev) return 0; } -#define AMDGPU_DM_DEFAULT_MIN_BACKLIGHT 12 +#define AMDGPU_DM_DEFAULT_MIN_BACKLIGHT 0 #define AMDGPU_DM_DEFAULT_MAX_BACKLIGHT 255 #define AUX_BL_DEFAULT_TRANSITION_TIME_MS 50 -- 2.31.0.291.g576ba9dcdaf-goog ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] dma-buf: use wake_up_process() instead of wake_up_state()
Am 19.03.21 um 03:58 schrieb Wang Qing: Using wake_up_process() is more simpler and friendly, and it is more convenient for analysis and statistics Signed-off-by: Wang Qing Reviewed-by: Christian König Should I pick it up or do you want to push it through some other tree than DRM? Thanks, Christian. --- drivers/dma-buf/dma-fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 7475e09..de51326 --- a/drivers/dma-buf/dma-fence.c +++ b/drivers/dma-buf/dma-fence.c @@ -655,7 +655,7 @@ dma_fence_default_wait_cb(struct dma_fence *fence, struct dma_fence_cb *cb) struct default_wait_cb *wait = container_of(cb, struct default_wait_cb, base); - wake_up_state(wait->task, TASK_NORMAL); + wake_up_process(wait->task); } /** ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 212281] AMDGPU warning stack trace in dmesg (dcn20_validate_bandwidth_fp)
https://bugzilla.kernel.org/show_bug.cgi?id=212281 --- Comment #4 from Tomas Sandven (tomas@sandven.email) --- Forgot to add, I'm using Sway (Wayland) and not X, so I don't have X logs to share. -- 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: [RESEND 00/53] Rid GPU from W=1 warnings
On Thu, 18 Mar 2021, Daniel Vetter wrote: > On Wed, Mar 17, 2021 at 9:32 PM Daniel Vetter wrote: > > > > On Wed, Mar 17, 2021 at 9:17 AM Lee Jones wrote: > > > > > > On Thu, 11 Mar 2021, Lee Jones wrote: > > > > > > > On Thu, 11 Mar 2021, Daniel Vetter wrote: > > > > > > > > > On Mon, Mar 08, 2021 at 09:19:32AM +, Lee Jones wrote: > > > > > > On Fri, 05 Mar 2021, Roland Scheidegger wrote: > > > > > > > > > > > > > The vmwgfx ones look all good to me, so for > > > > > > > 23-53: Reviewed-by: Roland Scheidegger > > > > > > > That said, they were already signed off by Zack, so not sure what > > > > > > > happened here. > > > > > > > > > > > > Yes, they were accepted at one point, then dropped without a reason. > > > > > > > > > > > > Since I rebased onto the latest -next, I had to pluck them back out > > > > > > of > > > > > > a previous one. > > > > > > > > > > They should show up in linux-next again. We merge patches for next > > > > > merge > > > > > window even during the current merge window, but need to make sure > > > > > they > > > > > don't pollute linux-next. Occasionally the cut off is wrong so patches > > > > > show up, and then get pulled again. > > > > > > > > > > Unfortunately especially the 5.12 merge cycle was very wobbly due to > > > > > some > > > > > confusion here. But your patches should all be in linux-next again > > > > > (they > > > > > are queued up for 5.13 in drm-misc-next, I checked that). > > > > > > > > > > Sorry for the confusion here. > > > > > > > > Oh, I see. Well so long as they don't get dropped, I'll be happy. > > > > > > > > Thanks for the explanation Daniel > > > > > > After rebasing today, all of my GPU patches have remained. Would > > > someone be kind enough to check that everything is still in order > > > please? > > > > It's still broken somehow. I've kiced Maxime and Maarten again, > > they're also on this thread. > > You're patches have made it into drm-next meanwhile, so they should > show up in linux-next through that tree at least. Except if that one > also has some trouble. Thanks for letting me know. I see some patches made it back in, others didn't. I'll resend the stragglers - bear with. -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[RESEND 00/19] Rid GPU from W=1 warnings
MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a resend of the remaining patches. All of these patches have been sent before. Lee Jones (19): drm/nouveau/nvkm/subdev/bios/init: Demote obvious abuse of kernel-doc drm/nouveau/dispnv50/disp: Remove unused variable 'ret' drm/msm/dp/dp_display: Remove unused variable 'hpd' include: drm: drm_atomic: Make use of 'new_plane_state' drm/nouveau/nvkm/subdev/volt/gk20a: Demote non-conformant kernel-doc headers drm/amd/display/dc/calcs/dce_calcs: Move some large variables from the stack to the heap drm/amd/display/dc/calcs/dce_calcs: Remove some large variables from the stack drm/amd/display/dc/dce80/dce80_resource: Make local functions static drm/nouveau/nvkm/engine/gr/gf100: Demote non-conformant kernel-doc header drm/nouveau/nouveau_bo: Remove unused variables 'dev' drm/nouveau/nouveau_display: Remove set but unused variable 'width' drm/nouveau/dispnv04/crtc: Demote non-conforming kernel-doc headers drm/nouveau/dispnv50/disp: Remove unused variable 'ret' from function returning void drm/nouveau/dispnv50/headc57d: Make local function 'headc57d_olut' static drm/nouveau/nv50_display: Remove superfluous prototype for local static functions drm/nouveau/dispnv50/disp: Include header containing our prototypes drm/nouveau/nouveau_ioc32: File headers are not good candidates for kernel-doc drm/nouveau/nouveau_svm: Remove unused variable 'ret' from void function drm/nouveau/nouveau_ioc32: Demote kernel-doc abuse to standard comment block .../gpu/drm/amd/display/dc/calcs/dce_calcs.c | 1154 + .../drm/amd/display/dc/dce80/dce80_resource.c | 16 +- drivers/gpu/drm/msm/dp/dp_display.c |3 - drivers/gpu/drm/nouveau/dispnv04/crtc.c |4 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 10 +- drivers/gpu/drm/nouveau/dispnv50/headc57d.c |2 +- drivers/gpu/drm/nouveau/nouveau_bo.c |4 - drivers/gpu/drm/nouveau/nouveau_display.c |8 +- drivers/gpu/drm/nouveau/nouveau_ioc32.c |4 +- drivers/gpu/drm/nouveau/nouveau_svm.c |5 +- drivers/gpu/drm/nouveau/nv50_display.h|3 - .../gpu/drm/nouveau/nvkm/engine/gr/gf100.c|2 +- .../gpu/drm/nouveau/nvkm/subdev/bios/init.c | 204 +-- .../gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c |4 +- include/drm/drm_atomic.h |3 +- 15 files changed, 692 insertions(+), 734 deletions(-) Cc: Alex Deucher Cc: amd-...@lists.freedesktop.org Cc: Anthony Koo Cc: Ben Skeggs Cc: "Christian König" Cc: Colin Ian King Cc: Daniel Vetter Cc: David Airlie Cc: dri-devel@lists.freedesktop.org Cc: freedr...@lists.freedesktop.org Cc: Harry Wentland Cc: Jeremy Kolb Cc: Kuogee Hsieh Cc: Leo Li Cc: linaro-mm-...@lists.linaro.org Cc: linux-arm-...@vger.kernel.org Cc: linux-me...@vger.kernel.org Cc: Lyude Paul Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: nouv...@lists.freedesktop.org Cc: Rob Clark Cc: Sean Paul Cc: Sumit Semwal Cc: Thomas Zimmermann -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 01/19] drm/nouveau/nvkm/subdev/bios/init: Demote obvious abuse of kernel-doc
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:584: warning: Function parameter or member 'init' not described in 'init_reserved' drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:611: warning: Function parameter or member 'init' not described in 'init_done' drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:622: warning: Function parameter or member 'init' not described in 'init_io_restrict_prog' drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:659: warning: Function parameter or member 'init' not described in 'init_repeat' drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:685: warning: Function parameter or member 'init' not described in 'init_io_restrict_pll' drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:725: warning: Function parameter or member 'init' not described in 'init_end_repeat' NB: Trimmed for brevity (lots of these!) Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- .../gpu/drm/nouveau/nvkm/subdev/bios/init.c | 204 ++ 1 file changed, 68 insertions(+), 136 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c index 9de74f41dcd2a..5a91dc4e5c8ec 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c @@ -575,9 +575,8 @@ init_tmds_reg(struct nvbios_init *init, u8 tmds) * init opcode handlers */ -/** +/* * init_reserved - stub for various unknown/unused single-byte opcodes - * */ static void init_reserved(struct nvbios_init *init) @@ -602,9 +601,8 @@ init_reserved(struct nvbios_init *init) init->offset += length; } -/** +/* * INIT_DONE - opcode 0x71 - * */ static void init_done(struct nvbios_init *init) @@ -613,9 +611,8 @@ init_done(struct nvbios_init *init) init->offset = 0x; } -/** +/* * INIT_IO_RESTRICT_PROG - opcode 0x32 - * */ static void init_io_restrict_prog(struct nvbios_init *init) @@ -650,9 +647,8 @@ init_io_restrict_prog(struct nvbios_init *init) trace("}]\n"); } -/** +/* * INIT_REPEAT - opcode 0x33 - * */ static void init_repeat(struct nvbios_init *init) @@ -676,9 +672,8 @@ init_repeat(struct nvbios_init *init) init->repeat = repeat; } -/** +/* * INIT_IO_RESTRICT_PLL - opcode 0x34 - * */ static void init_io_restrict_pll(struct nvbios_init *init) @@ -716,9 +711,8 @@ init_io_restrict_pll(struct nvbios_init *init) trace("}]\n"); } -/** +/* * INIT_END_REPEAT - opcode 0x36 - * */ static void init_end_repeat(struct nvbios_init *init) @@ -732,9 +726,8 @@ init_end_repeat(struct nvbios_init *init) } } -/** +/* * INIT_COPY - opcode 0x37 - * */ static void init_copy(struct nvbios_init *init) @@ -759,9 +752,8 @@ init_copy(struct nvbios_init *init) init_wrvgai(init, port, index, data); } -/** +/* * INIT_NOT - opcode 0x38 - * */ static void init_not(struct nvbios_init *init) @@ -771,9 +763,8 @@ init_not(struct nvbios_init *init) init_exec_inv(init); } -/** +/* * INIT_IO_FLAG_CONDITION - opcode 0x39 - * */ static void init_io_flag_condition(struct nvbios_init *init) @@ -788,9 +779,8 @@ init_io_flag_condition(struct nvbios_init *init) init_exec_set(init, false); } -/** +/* * INIT_GENERIC_CONDITION - opcode 0x3a - * */ static void init_generic_condition(struct nvbios_init *init) @@ -840,9 +830,8 @@ init_generic_condition(struct nvbios_init *init) } } -/** +/* * INIT_IO_MASK_OR - opcode 0x3b - * */ static void init_io_mask_or(struct nvbios_init *init) @@ -859,9 +848,8 @@ init_io_mask_or(struct nvbios_init *init) init_wrvgai(init, 0x03d4, index, data &= ~(1 << or)); } -/** +/* * INIT_IO_OR - opcode 0x3c - * */ static void init_io_or(struct nvbios_init *init) @@ -878,9 +866,8 @@ init_io_or(struct nvbios_init *init) init_wrvgai(init, 0x03d4, index, data | (1 << or)); } -/** +/* * INIT_ANDN_REG - opcode 0x47 - * */ static void init_andn_reg(struct nvbios_init *init) @@ -895,9 +882,8 @@ init_andn_reg(struct nvbios_init *init) init_mask(init, reg, mask, 0); } -/** +/* * INIT_OR_REG - opcode 0x48 - * */ static void init_or_reg(struct nvbios_init *init) @@ -912,9 +898,8 @@ init_or_reg(struct nvbios_init *init) init_mask(init, reg, 0, mask); } -/** +/* * INIT_INDEX_ADDRESS_LATCHED - opcode 0x49 - * */ static void init_idx_addr_latched(struct nvbios_init *init) @@ -942,9 +927,8 @@ init_idx_addr_latched(struct nvbios_init *init) } } -/** +/* * INIT_IO_RESTRICT_PLL2 - opcode 0x4a - * */ static void init_io_restrict_pll2(struct nvbios_init *init) @@ -977,9 +961,8 @@ init_io_restrict_pll2(struct nvbios_init *init) trace("}]\n"); } -/** +/* * INIT_PL
[PATCH 02/19] drm/nouveau/dispnv50/disp: Remove unused variable 'ret'
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/dispnv50/disp.c:1381:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 196612addfd61..c51efca82ac78 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1410,10 +1410,9 @@ nv50_mstm_prepare(struct nv50_mstm *mstm) { struct nouveau_drm *drm = nouveau_drm(mstm->outp->base.base.dev); struct drm_encoder *encoder; - int ret; NV_ATOMIC(drm, "%s: mstm prepare\n", mstm->outp->base.base.name); - ret = drm_dp_update_payload_part1(&mstm->mgr); + drm_dp_update_payload_part1(&mstm->mgr); drm_for_each_encoder(encoder, mstm->outp->base.base.dev) { if (encoder->encoder_type == DRM_MODE_ENCODER_DPMST) { -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 04/19] include: drm: drm_atomic: Make use of 'new_plane_state'
In the macro for_each_oldnew_plane_in_state() 'new_plane_state' is provided as a container for state->planes[i].new_state, but is not utilised in some use-cases, so we fake-use it instead. Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function ‘amdgpu_dm_commit_cursors’: drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7649:44: warning: variable ‘new_plane_state’ set but not used [-Wunused-but-set-variable] Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Rob Clark Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones --- include/drm/drm_atomic.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index ac5a28eff2c86..259e6970dc836 100644 --- a/include/drm/drm_atomic.h +++ b/include/drm/drm_atomic.h @@ -871,7 +871,8 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); ((plane) = (__state)->planes[__i].ptr, \ (void)(plane) /* Only to avoid unused-but-set-variable warning */, \ (old_plane_state) = (__state)->planes[__i].old_state,\ - (new_plane_state) = (__state)->planes[__i].new_state, 1)) + (new_plane_state) = (__state)->planes[__i].new_state, \ + (void)(new_plane_state) /* Only to avoid unused-but-set-variable warning */, 1)) /** * for_each_oldnew_plane_in_state_reverse - iterate over all planes in an atomic -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 03/19] drm/msm/dp/dp_display: Remove unused variable 'hpd'
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/msm/dp/dp_display.c: In function ‘dp_display_usbpd_attention_cb’: drivers/gpu/drm/msm/dp/dp_display.c:496:19: warning: variable ‘hpd’ set but not used [-Wunused-but-set-variable] Cc: Rob Clark Cc: Sean Paul Cc: David Airlie Cc: Daniel Vetter Cc: Kuogee Hsieh Cc: linux-arm-...@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: freedr...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/msm/dp/dp_display.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 5a39da6e1eaf2..31bf2a40a9eb2 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -493,7 +493,6 @@ static int dp_display_usbpd_attention_cb(struct device *dev) int rc = 0; u32 sink_request; struct dp_display_private *dp; - struct dp_usbpd *hpd; if (!dev) { DRM_ERROR("invalid dev\n"); @@ -507,8 +506,6 @@ static int dp_display_usbpd_attention_cb(struct device *dev) return -ENODEV; } - hpd = dp->usbpd; - /* check for any test request issued by sink */ rc = dp_link_process_request(dp->link); if (!rc) { -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 05/19] drm/nouveau/nvkm/subdev/volt/gk20a: Demote non-conformant kernel-doc headers
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:53: warning: Function parameter or member 'speedo' not described in 'gk20a_volt_get_cvb_voltage' drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:53: warning: Function parameter or member 's_scale' not described in 'gk20a_volt_get_cvb_voltage' drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:53: warning: Function parameter or member 'coef' not described in 'gk20a_volt_get_cvb_voltage' drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:69: warning: Function parameter or member 'speedo' not described in 'gk20a_volt_get_cvb_t_voltage' drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:69: warning: Function parameter or member 'temp' not described in 'gk20a_volt_get_cvb_t_voltage' drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:69: warning: Function parameter or member 's_scale' not described in 'gk20a_volt_get_cvb_t_voltage' drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:69: warning: Function parameter or member 't_scale' not described in 'gk20a_volt_get_cvb_t_voltage' drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:69: warning: Function parameter or member 'coef' not described in 'gk20a_volt_get_cvb_t_voltage' Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c index 8c2faa9645111..ccac88da88648 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c @@ -45,7 +45,7 @@ static const struct cvb_coef gk20a_cvb_coef[] = { /* 852 */ { 1608418, -21643, -269, 0,763, -48}, }; -/** +/* * cvb_mv = ((c2 * speedo / s_scale + c1) * speedo / s_scale + c0) */ static inline int @@ -58,7 +58,7 @@ gk20a_volt_get_cvb_voltage(int speedo, int s_scale, const struct cvb_coef *coef) return mv; } -/** +/* * cvb_t_mv = * ((c2 * speedo / s_scale + c1) * speedo / s_scale + c0) + * ((c3 * speedo / s_scale + c4 + c5 * T / t_scale) * T / t_scale) -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 06/19] drm/amd/display/dc/calcs/dce_calcs: Move some large variables from the stack to the heap
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function ‘calculate_bandwidth’: drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:2016:1: warning: the frame size of 1216 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Harry Wentland Cc: Leo Li Cc: Alex Deucher Cc: "Christian König" Cc: David Airlie Cc: Daniel Vetter Cc: Colin Ian King Cc: amd-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones --- .../gpu/drm/amd/display/dc/calcs/dce_calcs.c | 32 --- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c index e633f8a51edb6..9d8f2505a61c2 100644 --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c @@ -98,16 +98,16 @@ static void calculate_bandwidth( int32_t num_cursor_lines; int32_t i, j, k; - struct bw_fixed yclk[3]; - struct bw_fixed sclk[8]; + struct bw_fixed *yclk; + struct bw_fixed *sclk; bool d0_underlay_enable; bool d1_underlay_enable; bool fbc_enabled; bool lpt_enabled; enum bw_defines sclk_message; enum bw_defines yclk_message; - enum bw_defines tiling_mode[maximum_number_of_surfaces]; - enum bw_defines surface_type[maximum_number_of_surfaces]; + enum bw_defines *tiling_mode; + enum bw_defines *surface_type; enum bw_defines voltage; enum bw_defines pipe_check; enum bw_defines hsr_check; @@ -122,6 +122,22 @@ static void calculate_bandwidth( int32_t number_of_displays_enabled_with_margin = 0; int32_t number_of_aligned_displays_with_no_margin = 0; + yclk = kcalloc(3, sizeof(*yclk), GFP_KERNEL); + if (!yclk) + return; + + sclk = kcalloc(8, sizeof(*sclk), GFP_KERNEL); + if (!sclk) + goto free_yclk; + + tiling_mode = kcalloc(maximum_number_of_surfaces, sizeof(*tiling_mode), GFP_KERNEL); + if (!tiling_mode) + goto free_sclk; + + surface_type = kcalloc(maximum_number_of_surfaces, sizeof(*surface_type), GFP_KERNEL); + if (!surface_type) + goto free_tiling_mode; + yclk[low] = vbios->low_yclk; yclk[mid] = vbios->mid_yclk; yclk[high] = vbios->high_yclk; @@ -2013,6 +2029,14 @@ static void calculate_bandwidth( } } } + + kfree(surface_type); +free_tiling_mode: + kfree(tiling_mode); +free_yclk: + kfree(yclk); +free_sclk: + kfree(sclk); } /*** -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 09/19] drm/nouveau/nvkm/engine/gr/gf100: Demote non-conformant kernel-doc header
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c:992: warning: Function parameter or member 'gr' not described in 'gf100_gr_wait_idle' Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c index 397ff4fe9df89..69e6008f99196 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c @@ -982,7 +982,7 @@ gf100_gr_zbc_init(struct gf100_gr *gr) } } -/** +/* * Wait until GR goes idle. GR is considered idle if it is disabled by the * MC (0x200) register, or GR is not busy and a context switch is not in * progress. -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 08/19] drm/amd/display/dc/dce80/dce80_resource: Make local functions static
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:527:17: warning: no previous prototype for ‘dce80_aux_engine_create’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:565:20: warning: no previous prototype for ‘dce80_i2c_hw_create’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:581:20: warning: no previous prototype for ‘dce80_i2c_sw_create’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:715:22: warning: no previous prototype for ‘dce80_link_encoder_create’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:754:22: warning: no previous prototype for ‘dce80_clock_source_create’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:778:6: warning: no previous prototype for ‘dce80_clock_source_destroy’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:868:6: warning: no previous prototype for ‘dce80_validate_bandwidth’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:913:16: warning: no previous prototype for ‘dce80_validate_global’ [-Wmissing-prototypes] Cc: Harry Wentland Cc: Leo Li Cc: Alex Deucher Cc: "Christian König" Cc: David Airlie Cc: Daniel Vetter Cc: Anthony Koo Cc: amd-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones --- .../drm/amd/display/dc/dce80/dce80_resource.c| 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c index 612450f992782..725d92e40cd30 100644 --- a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c @@ -526,7 +526,7 @@ static struct output_pixel_processor *dce80_opp_create( return &opp->base; } -struct dce_aux *dce80_aux_engine_create( +static struct dce_aux *dce80_aux_engine_create( struct dc_context *ctx, uint32_t inst) { @@ -564,7 +564,7 @@ static const struct dce_i2c_mask i2c_masks = { I2C_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(_MASK) }; -struct dce_i2c_hw *dce80_i2c_hw_create( +static struct dce_i2c_hw *dce80_i2c_hw_create( struct dc_context *ctx, uint32_t inst) { @@ -580,7 +580,7 @@ struct dce_i2c_hw *dce80_i2c_hw_create( return dce_i2c_hw; } -struct dce_i2c_sw *dce80_i2c_sw_create( +static struct dce_i2c_sw *dce80_i2c_sw_create( struct dc_context *ctx) { struct dce_i2c_sw *dce_i2c_sw = @@ -714,7 +714,7 @@ static const struct encoder_feature_support link_enc_feature = { .flags.bits.IS_TPS3_CAPABLE = true }; -struct link_encoder *dce80_link_encoder_create( +static struct link_encoder *dce80_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = @@ -753,7 +753,7 @@ static struct panel_cntl *dce80_panel_cntl_create(const struct panel_cntl_init_d return &panel_cntl->base; } -struct clock_source *dce80_clock_source_create( +static struct clock_source *dce80_clock_source_create( struct dc_context *ctx, struct dc_bios *bios, enum clock_source_id id, @@ -777,7 +777,7 @@ struct clock_source *dce80_clock_source_create( return NULL; } -void dce80_clock_source_destroy(struct clock_source **clk_src) +static void dce80_clock_source_destroy(struct clock_source **clk_src) { kfree(TO_DCE110_CLK_SRC(*clk_src)); *clk_src = NULL; @@ -867,7 +867,7 @@ static void dce80_resource_destruct(struct dce110_resource_pool *pool) } } -bool dce80_validate_bandwidth( +static bool dce80_validate_bandwidth( struct dc *dc, struct dc_state *context, bool fast_validate) @@ -912,7 +912,7 @@ static bool dce80_validate_surface_sets( return true; } -enum dc_status dce80_validate_global( +static enum dc_status dce80_validate_global( struct dc *dc, struct dc_state *context) { -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 10/19] drm/nouveau/nouveau_bo: Remove unused variables 'dev'
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nouveau_bo.c: In function ‘nouveau_ttm_tt_populate’: drivers/gpu/drm/nouveau/nouveau_bo.c:1228:17: warning: variable ‘dev’ set but not used [-Wunused-but-set-variable] drivers/gpu/drm/nouveau/nouveau_bo.c: In function ‘nouveau_ttm_tt_unpopulate’: drivers/gpu/drm/nouveau/nouveau_bo.c:1252:17: warning: variable ‘dev’ set but not used [-Wunused-but-set-variable] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: Sumit Semwal Cc: "Christian König" Cc: Jeremy Kolb Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Cc: linux-me...@vger.kernel.org Cc: linaro-mm-...@lists.linaro.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/nouveau_bo.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 281e9ed139895..913035ab85ec2 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1250,7 +1250,6 @@ nouveau_ttm_tt_populate(struct ttm_device *bdev, { struct ttm_tt *ttm_dma = (void *)ttm; struct nouveau_drm *drm; - struct device *dev; bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); if (ttm_tt_is_populated(ttm)) @@ -1263,7 +1262,6 @@ nouveau_ttm_tt_populate(struct ttm_device *bdev, } drm = nouveau_bdev(bdev); - dev = drm->dev->dev; return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx); } @@ -1273,14 +1271,12 @@ nouveau_ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm) { struct nouveau_drm *drm; - struct device *dev; bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); if (slave) return; drm = nouveau_bdev(bdev); - dev = drm->dev->dev; return ttm_pool_free(&drm->ttm.bdev.pool, ttm); } -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 15/19] drm/nouveau/nv50_display: Remove superfluous prototype for local static functions
Fixes the following build error: drivers/gpu/drm/nouveau/dispnv50/disp.c:2530:1: error: conflicting types for ‘nv50_display_fini’ In file included from drivers/gpu/drm/nouveau/dispnv50/disp.c:71: drivers/gpu/drm/nouveau/nv50_display.h:36:6: note: previous declaration of ‘nv50_display_fini’ was her In file included from drivers/gpu/drm/nouveau/dispnv50/disp.c:71: drivers/gpu/drm/nouveau/nv50_display.h:35:6: note: previous declaration of ‘nv50_display_init’ was here drivers/gpu/drm/nouveau/dispnv50/disp.c:2581:1: error: static declaration of ‘nv50_display_destroy’ follows non-static declaration In file included from drivers/gpu/drm/nouveau/dispnv50/disp.c:71: drivers/gpu/drm/nouveau/nv50_display.h:34:6: note: previous declaration of ‘nv50_display_destroy’ was here Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/nv50_display.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nv50_display.h b/drivers/gpu/drm/nouveau/nv50_display.h index fbd3b15583bc8..2421401d12636 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.h +++ b/drivers/gpu/drm/nouveau/nv50_display.h @@ -31,7 +31,4 @@ #include "nouveau_reg.h" int nv50_display_create(struct drm_device *); -void nv50_display_destroy(struct drm_device *); -int nv50_display_init(struct drm_device *); -void nv50_display_fini(struct drm_device *); #endif /* __NV50_DISPLAY_H__ */ -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 13/19] drm/nouveau/dispnv50/disp: Remove unused variable 'ret' from function returning void
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/dispnv50/disp.c: In function ‘nv50_mstm_cleanup’: drivers/gpu/drm/nouveau/dispnv50/disp.c:1357:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index c51efca82ac78..828f48d5bdd4e 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -1386,12 +1386,11 @@ nv50_mstm_cleanup(struct nv50_mstm *mstm) { struct nouveau_drm *drm = nouveau_drm(mstm->outp->base.base.dev); struct drm_encoder *encoder; - int ret; NV_ATOMIC(drm, "%s: mstm cleanup\n", mstm->outp->base.base.name); - ret = drm_dp_check_act_status(&mstm->mgr); + drm_dp_check_act_status(&mstm->mgr); - ret = drm_dp_update_payload_part2(&mstm->mgr); + drm_dp_update_payload_part2(&mstm->mgr); drm_for_each_encoder(encoder, mstm->outp->base.base.dev) { if (encoder->encoder_type == DRM_MODE_ENCODER_DPMST) { -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 11/19] drm/nouveau/nouveau_display: Remove set but unused variable 'width'
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nouveau_display.c: In function ‘nouveau_framebuffer_new’: drivers/gpu/drm/nouveau/nouveau_display.c:309:15: warning: variable ‘width’ set but not used [-Wunused-but-set-variable] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/nouveau_display.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index dac02c7be54dc..be2327ce7394c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -306,7 +306,7 @@ nouveau_framebuffer_new(struct drm_device *dev, struct nouveau_bo *nvbo = nouveau_gem_object(gem); struct drm_framebuffer *fb; const struct drm_format_info *info; - unsigned int width, height, i; + unsigned int height, i; uint32_t tile_mode; uint8_t kind; int ret; @@ -343,9 +343,9 @@ nouveau_framebuffer_new(struct drm_device *dev, info = drm_get_format_info(dev, mode_cmd); for (i = 0; i < info->num_planes; i++) { - width = drm_format_info_plane_width(info, - mode_cmd->width, - i); + drm_format_info_plane_width(info, + mode_cmd->width, + i); height = drm_format_info_plane_height(info, mode_cmd->height, i); -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 0/5] drm/vc4: hdmi: Support the 4k @ 60Hz modes
Hi, I looked through the patches. I can't say much about the technical side, but for the patches themselves Acked-by: Thomas Zimmermann Just one nit: I've seen the pattern (mode->clock * 1000) < HDMI_14_MAX_TMDS_CLK in several places. I suggest to add a little helper with a descriptive name. Best regards Thomas Am 18.03.21 um 10:29 schrieb Maxime Ripard: Hi, Here is a series that enables the higher resolutions on the HDMI0 Controller found in the BCM2711 (RPi4). In order to work it needs a few adjustments to config.txt, most notably to enable the enable_hdmi_4kp60 option. The firmware also has a glitch at the moment and will not properly release the BSC controllers, which will make the EDID retrieval fail. We can work around this using the following config.txt options: disable_fw_kms_setup=1 hdmi_edid_file:0=1 hdmi_edid_filename:0=1366x768.bin hdmi_ignore_edid:0=1 hdmi_edid_file:1=1 hdmi_edid_filename:1=1366x768.bin hdmi_ignore_edid:1=1 A fix will come for the firmware eventually. Let me know what you think, Maxime --- Changes from v1: - Dropped the range accessors - Drop the mention of force_turbo - Reordered the SCRAMBLER_CTL register to match the offset - Removed duplicate HDMI_14_MAX_TMDS_CLK define - Warn about enable_hdmi_4kp60 only if there's some modes that can't be reached - Rework the BVB clock computation Maxime Ripard (5): drm/vc4: hvs: Make the HVS bind first drm/vc4: hdmi: Properly compute the BVB clock rate drm/vc4: hdmi: Check and warn if we can't reach 4kp60 frequencies drm/vc4: hdmi: Enable the scrambler drm/vc4: hdmi: Raise the maximum clock rate drivers/gpu/drm/vc4/vc4_drv.c | 11 ++- drivers/gpu/drm/vc4/vc4_hdmi.c | 101 +--- drivers/gpu/drm/vc4/vc4_hdmi.h | 8 +++ drivers/gpu/drm/vc4/vc4_hdmi_regs.h | 3 + 4 files changed, 113 insertions(+), 10 deletions(-) -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer OpenPGP_signature Description: OpenPGP digital signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 07/19] drm/amd/display/dc/calcs/dce_calcs: Remove some large variables from the stack
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function ‘bw_calcs_init’: drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:2726:1: warning: the frame size of 1336 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Harry Wentland Cc: Leo Li Cc: Alex Deucher Cc: "Christian König" Cc: David Airlie Cc: Daniel Vetter Cc: amd-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones --- .../gpu/drm/amd/display/dc/calcs/dce_calcs.c | 1122 + 1 file changed, 567 insertions(+), 555 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c index 9d8f2505a61c2..556ecfabc8d2a 100644 --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c @@ -2046,707 +2046,719 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip, struct bw_calcs_vbios *bw_vbios, struct hw_asic_id asic_id) { - struct bw_calcs_dceip dceip = { 0 }; - struct bw_calcs_vbios vbios = { 0 }; + struct bw_calcs_dceip *dceip; + struct bw_calcs_vbios *vbios; enum bw_calcs_version version = bw_calcs_version_from_asic_id(asic_id); - dceip.version = version; + dceip = kzalloc(sizeof(dceip), GFP_KERNEL); + if (!dceip) + return; + + vbios = kzalloc(sizeof(vbios), GFP_KERNEL); + if (!vbios) { + kfree(dceip); + return; + } + + dceip->version = version; switch (version) { case BW_CALCS_VERSION_CARRIZO: - vbios.memory_type = bw_def_gddr5; - vbios.dram_channel_width_in_bits = 64; - vbios.number_of_dram_channels = asic_id.vram_width / vbios.dram_channel_width_in_bits; - vbios.number_of_dram_banks = 8; - vbios.high_yclk = bw_int_to_fixed(1600); - vbios.mid_yclk = bw_int_to_fixed(1600); - vbios.low_yclk = bw_frc_to_fixed(6, 100); - vbios.low_sclk = bw_int_to_fixed(200); - vbios.mid1_sclk = bw_int_to_fixed(300); - vbios.mid2_sclk = bw_int_to_fixed(300); - vbios.mid3_sclk = bw_int_to_fixed(300); - vbios.mid4_sclk = bw_int_to_fixed(300); - vbios.mid5_sclk = bw_int_to_fixed(300); - vbios.mid6_sclk = bw_int_to_fixed(300); - vbios.high_sclk = bw_frc_to_fixed(62609, 100); - vbios.low_voltage_max_dispclk = bw_int_to_fixed(352); - vbios.mid_voltage_max_dispclk = bw_int_to_fixed(467); - vbios.high_voltage_max_dispclk = bw_int_to_fixed(643); - vbios.low_voltage_max_phyclk = bw_int_to_fixed(540); - vbios.mid_voltage_max_phyclk = bw_int_to_fixed(810); - vbios.high_voltage_max_phyclk = bw_int_to_fixed(810); - vbios.data_return_bus_width = bw_int_to_fixed(32); - vbios.trc = bw_int_to_fixed(50); - vbios.dmifmc_urgent_latency = bw_int_to_fixed(4); - vbios.stutter_self_refresh_exit_latency = bw_frc_to_fixed(153, 10); - vbios.stutter_self_refresh_entry_latency = bw_int_to_fixed(0); - vbios.nbp_state_change_latency = bw_frc_to_fixed(19649, 1000); - vbios.mcifwrmc_urgent_latency = bw_int_to_fixed(10); - vbios.scatter_gather_enable = true; - vbios.down_spread_percentage = bw_frc_to_fixed(5, 10); - vbios.cursor_width = 32; - vbios.average_compression_rate = 4; - vbios.number_of_request_slots_gmc_reserves_for_dmif_per_channel = 256; - vbios.blackout_duration = bw_int_to_fixed(0); /* us */ - vbios.maximum_blackout_recovery_time = bw_int_to_fixed(0); - - dceip.max_average_percent_of_ideal_port_bw_display_can_use_in_normal_system_operation = 100; - dceip.max_average_percent_of_ideal_drambw_display_can_use_in_normal_system_operation = 100; - dceip.percent_of_ideal_port_bw_received_after_urgent_latency = 100; - dceip.large_cursor = false; - dceip.dmif_request_buffer_size = bw_int_to_fixed(768); - dceip.dmif_pipe_en_fbc_chunk_tracker = false; - dceip.cursor_max_outstanding_group_num = 1; - dceip.lines_interleaved_into_lb = 2; - dceip.chunk_width = 256; - dceip.number_of_graphics_pipes = 3; - dceip.number_of_underlay_pipes = 1; - dceip.low_power_tiling_mode = 0; - dceip.display_write_back_supported = false; - dceip.argb_compression_support = false; - dceip.underlay_vscaler_efficiency6_bit_per_component = + vbios->memory_type = bw_def_gddr5; + vbios->dram_channel_widt
[PATCH 19/19] drm/nouveau/nouveau_ioc32: Demote kernel-doc abuse to standard comment block
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nouveau_ioc32.c:52: warning: Function parameter or member 'filp' not described in 'nouveau_compat_ioctl' drivers/gpu/drm/nouveau/nouveau_ioc32.c:52: warning: Function parameter or member 'cmd' not described in 'nouveau_compat_ioctl' drivers/gpu/drm/nouveau/nouveau_ioc32.c:52: warning: Function parameter or member 'arg' not described in 'nouveau_compat_ioctl' Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/nouveau_ioc32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ioc32.c b/drivers/gpu/drm/nouveau/nouveau_ioc32.c index 8ddf9b2325a42..2af3615c5205c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ioc32.c +++ b/drivers/gpu/drm/nouveau/nouveau_ioc32.c @@ -38,7 +38,7 @@ #include "nouveau_ioctl.h" -/** +/* * Called whenever a 32-bit process running under a 64-bit kernel * performs an ioctl on /dev/dri/card. * -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 17/19] drm/nouveau/nouveau_ioc32: File headers are not good candidates for kernel-doc
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nouveau_ioc32.c:2: warning: Cannot understand * file mga_ioc32.c Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/nouveau_ioc32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_ioc32.c b/drivers/gpu/drm/nouveau/nouveau_ioc32.c index adf01ca9e035d..8ddf9b2325a42 100644 --- a/drivers/gpu/drm/nouveau/nouveau_ioc32.c +++ b/drivers/gpu/drm/nouveau/nouveau_ioc32.c @@ -1,4 +1,4 @@ -/** +/* * \file mga_ioc32.c * * 32-bit ioctl compatibility routines for the MGA DRM. -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 12/19] drm/nouveau/dispnv04/crtc: Demote non-conforming kernel-doc headers
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/dispnv04/crtc.c:462: warning: Function parameter or member 'crtc' not described in 'nv_crtc_mode_set_regs' drivers/gpu/drm/nouveau/dispnv04/crtc.c:462: warning: Function parameter or member 'mode' not described in 'nv_crtc_mode_set_regs' drivers/gpu/drm/nouveau/dispnv04/crtc.c:640: warning: Function parameter or member 'crtc' not described in 'nv_crtc_mode_set' drivers/gpu/drm/nouveau/dispnv04/crtc.c:640: warning: Function parameter or member 'mode' not described in 'nv_crtc_mode_set' drivers/gpu/drm/nouveau/dispnv04/crtc.c:640: warning: Function parameter or member 'adjusted_mode' not described in 'nv_crtc_mode_set' drivers/gpu/drm/nouveau/dispnv04/crtc.c:640: warning: Function parameter or member 'x' not described in 'nv_crtc_mode_set' drivers/gpu/drm/nouveau/dispnv04/crtc.c:640: warning: Function parameter or member 'y' not described in 'nv_crtc_mode_set' drivers/gpu/drm/nouveau/dispnv04/crtc.c:640: warning: Function parameter or member 'old_fb' not described in 'nv_crtc_mode_set' Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c index f9e962fd94d0d..f9a276ea5a9e0 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c @@ -449,7 +449,7 @@ nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct drm_display_mode *mode) regp->Attribute[NV_CIO_AR_CSEL_INDEX] = 0x00; } -/** +/* * Sets up registers for the given mode/adjusted_mode pair. * * The clocks, CRTCs and outputs attached to this CRTC must be off. @@ -625,7 +625,7 @@ nv_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb) return ret; } -/** +/* * Sets up registers for the given mode/adjusted_mode pair. * * The clocks, CRTCs and outputs attached to this CRTC must be off. -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 14/19] drm/nouveau/dispnv50/headc57d: Make local function 'headc57d_olut' static
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/dispnv50/headc57d.c:173:1: warning: no previous prototype for ‘headc57d_olut’ [-Wmissing-prototypes] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: Lyude Paul Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/dispnv50/headc57d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/headc57d.c b/drivers/gpu/drm/nouveau/dispnv50/headc57d.c index fd51527b56b83..bdcfd240d61c8 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/headc57d.c +++ b/drivers/gpu/drm/nouveau/dispnv50/headc57d.c @@ -169,7 +169,7 @@ headc57d_olut_load(struct drm_color_lut *in, int size, void __iomem *mem) writew(readw(mem - 4), mem + 4); } -bool +static bool headc57d_olut(struct nv50_head *head, struct nv50_head_atom *asyh, int size) { if (size != 0 && size != 256 && size != 1024) -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 16/19] drm/nouveau/dispnv50/disp: Include header containing our prototypes
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/dispnv50/disp.c:2599:1: warning: no previous prototype for ‘nv50_display_create’ [-Wmissing-prototypes] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 828f48d5bdd4e..cd16431422198 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -68,6 +68,8 @@ #include +#include "nv50_display.h" + /** * EVO channel */ -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 18/19] drm/nouveau/nouveau_svm: Remove unused variable 'ret' from void function
Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/nouveau_svm.c: In function ‘nouveau_pfns_map’: drivers/gpu/drm/nouveau/nouveau_svm.c:810:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouv...@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/nouveau/nouveau_svm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c index 1c3f890377d2c..26af6ee915368 100644 --- a/drivers/gpu/drm/nouveau/nouveau_svm.c +++ b/drivers/gpu/drm/nouveau/nouveau_svm.c @@ -811,7 +811,6 @@ nouveau_pfns_map(struct nouveau_svmm *svmm, struct mm_struct *mm, unsigned long addr, u64 *pfns, unsigned long npages) { struct nouveau_pfnmap_args *args = nouveau_pfns_to_args(pfns); - int ret; args->p.addr = addr; args->p.size = npages << PAGE_SHIFT; @@ -819,8 +818,8 @@ nouveau_pfns_map(struct nouveau_svmm *svmm, struct mm_struct *mm, mutex_lock(&svmm->mutex); svmm->vmm->vmm.object.client->super = true; - ret = nvif_object_ioctl(&svmm->vmm->vmm.object, args, sizeof(*args) + - npages * sizeof(args->p.phys[0]), NULL); + nvif_object_ioctl(&svmm->vmm->vmm.object, args, sizeof(*args) + + npages * sizeof(args->p.phys[0]), NULL); svmm->vmm->vmm.object.client->super = false; mutex_unlock(&svmm->mutex); -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/nouveau: Remove unused variable ret
Fix the following coccicheck warnings: ./drivers/gpu/drm/nouveau/nouveau_bios.c:2048:5-8: Unneeded variable: "ret". Return "0" on line 2061. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- drivers/gpu/drm/nouveau/nouveau_bios.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index e8c445e..41b78e9 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c @@ -2045,7 +2045,6 @@ static bool NVInitVBIOS(struct drm_device *dev) { struct nouveau_drm *drm = nouveau_drm(dev); struct nvbios *bios = &drm->vbios; - int ret = 0; /* Reset the BIOS head to 0. */ bios->state.crtchead = 0; @@ -2058,7 +2057,7 @@ static bool NVInitVBIOS(struct drm_device *dev) bios->fp.lvds_init_run = false; } - return ret; + return 0; } static bool -- 1.8.3.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2] drm/loongson: Add DDC support for loongson display controller
Hi, sunhao. > > Add GPIO and I2C driver to detect connector and fetch EDID via DDC. > It's even better to add what V2 has changed. > Signed-off-by: Hao Sun > --- > drivers/gpu/drm/loongson/Makefile | 3 +- > drivers/gpu/drm/loongson/loongson_connector.c | 120 +++- > drivers/gpu/drm/loongson/loongson_drv.c | 16 +- > drivers/gpu/drm/loongson/loongson_drv.h | 10 + > drivers/gpu/drm/loongson/loongson_i2c.c | 264 ++ > drivers/gpu/drm/loongson/loongson_i2c.h | 40 +++ > 6 files changed, 446 insertions(+), 7 deletions(-) > create mode 100644 drivers/gpu/drm/loongson/loongson_i2c.c > create mode 100644 drivers/gpu/drm/loongson/loongson_i2c.h > > diff --git a/drivers/gpu/drm/loongson/Makefile > b/drivers/gpu/drm/loongson/Makefile > index 22d063953..773b806e9 100644 > --- a/drivers/gpu/drm/loongson/Makefile > +++ b/drivers/gpu/drm/loongson/Makefile > @@ -10,5 +10,6 @@ loongson-y := loongson_drv.o \ > loongson_plane.o \ > loongson_device.o \ > loongson_connector.o \ > -loongson_encoder.o > +loongson_encoder.o \ > +loongson_i2c.o > obj-$(CONFIG_DRM_LOONGSON) += loongson.o > diff --git a/drivers/gpu/drm/loongson/loongson_connector.c > b/drivers/gpu/drm/loongson/loongson_connector.c > index 6b1f0ffa3..e0aea8553 100644 > --- a/drivers/gpu/drm/loongson/loongson_connector.c > +++ b/drivers/gpu/drm/loongson/loongson_connector.c > @@ -2,14 +2,117 @@ > > #include "loongson_drv.h" > > +static int loongson_do_probe_ddc_edid(struct i2c_adapter *adapter, > + unsigned char *buf) > +{ > +u8 start = 0x0; > +u32 che_tmp = 0; > +u32 i; > + > +struct i2c_msg msgs[] = { { > +.addr = DDC_ADDR, > +.flags = 0, > +.len = 1, > +.buf = &start, > +}, > +{ > +.addr = DDC_ADDR, > +.flags = I2C_M_RD, > +.len = EDID_LENGTH * 2, > +.buf = buf, > +} }; > + > +if (i2c_transfer(adapter, msgs, 2) == 2) { > +if (buf[126] != 0) { > +buf[126] = 0; > +che_tmp = 0; > +for (i = 0; i < 127; i++) > +che_tmp += buf[i]; > +buf[127] = 256 - (che_tmp) % 256; > +} > +if (!drm_edid_block_valid(buf, 0, true, NULL)) { > +dev_warn_once(&adapter->dev, "Invalid EDID block\n"); > +return false; > +} > +} else { > +dev_warn_once(&adapter->dev, "unable to read EDID block\n"); > +return false; > +} > + > +return true; > +} > + > +static bool get_edid_i2c(struct loongson_connector *lconnector, u8 *edid) > +{ > +struct loongson_i2c *i2c = lconnector->i2c; > +bool ret = false; > + > +if (i2c != NULL && i2c->adapter != NULL) > +ret = loongson_do_probe_ddc_edid(i2c->adapter, edid); > +else > +DRM_INFO_ONCE("get loongson connector adapter err\n"); > + > +return ret; > +} can use drm_get_edid get edid,you can delete get_edid_i2c and loongson_do_probe_ddc_edid > + > static int loongson_get_modes(struct drm_connector *connector) > { > -int count; > +struct loongson_connector *lconnector; > +u8 edid[EDID_LENGTH * 2]; > +u32 size; > +bool success; > +u32 ret; > + > +lconnector = to_loongson_connector(connector); > +size = sizeof(u8) * EDID_LENGTH * 2; > + > +success = get_edid_i2c(lconnector, edid); > + > +if (success) { > +drm_connector_update_edid_property(connector, > +(struct edid *)edid); > +ret = drm_add_edid_modes(connector, (struct edid *)edid); > +} else > +ret = drm_add_modes_noedid(connector, 1024, 768); > + > +return ret; > +} > + > +static bool is_connected(struct loongson_connector *ls_connector) > +{ > +unsigned char start = 0x0; > +struct i2c_adapter *adapter; > +struct i2c_msg msgs = { > +.addr = DDC_ADDR, > +.flags = 0, > +.len = 1, > +.buf = &start, > +}; > + > +if (!ls_connector->i2c) > +return false; > > -count = drm_add_modes_noedid(connector, 1920, 1080); > -drm_set_preferred_mode(connector, 1024, 768); > +adapter = ls_connector->i2c->adapter; > +if (i2c_transfer(adapter, &msgs, 1) != 1) { > +DRM_DEBUG_KMS("display-%d not connect\n", ls_connector->id); > +return false; > +} > > -return count; > +return true; > +} > + > +static enum drm_connector_status > +loongson_detect(struct drm_connector *connector, bool force) > +{ > +struct loongson_connector *lconnector; > +enum drm_connector_status ret = connector_status_disconnected; > + > +lconnector = to_loongson_connector(connector); > + > +if (is_connected(lconnector)) > +ret = connector_status_connected; > + > +return ret; > } > > static const struct drm_connector_helper_funcs loongson_connector_helper = { > @@ -17,6 +120,7 @@ static const struct drm_connector_helper_funcs > loongson_connector_helper = { > }; > > static const struct drm_connector_funcs loongson_connector_funcs = { > +.detect = loongson_detect, > .fill_modes = drm_helper_probe_single_connector_modes, > .destroy = drm_connector_cleanup, > .reset = drm_atomic_helper_connector_reset, > @@ -37,11 +141,17 @@ int loongson_connector_init(struct loongson_device > *ldev, int index) > > l
[PATCH v5 0/2] enable HDCP in Cadence MHDP bridge driver
This patch series enables HDCP in Cadence MHDP DPI/DP bridge driver. Changes since v1: - Move sapb reg block right after apb reg block - Corresponding changes in binding and example Changes since v2: - Revert reg resource sequence in binding and use resource mapping by name - Remove hdcp_config from binding and use DRM HDCP Content Type property to select HDCP version Changes since v3: - Fix kernel test robot warning Changes since v4: - Fix binding issue Parshuram Thombare (2): dt-bindings: drm/bridge: MHDP8546 bridge binding changes for HDCP drm: bridge: cdns-mhdp8546: Enable HDCP .../display/bridge/cdns,mhdp8546.yaml | 34 +- drivers/gpu/drm/bridge/cadence/Makefile | 2 +- .../drm/bridge/cadence/cdns-mhdp8546-core.c | 113 +++- .../drm/bridge/cadence/cdns-mhdp8546-core.h | 21 + .../drm/bridge/cadence/cdns-mhdp8546-hdcp.c | 570 ++ .../drm/bridge/cadence/cdns-mhdp8546-hdcp.h | 92 +++ 6 files changed, 806 insertions(+), 26 deletions(-) create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.h -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 1/2] dt-bindings: drm/bridge: MHDP8546 bridge binding changes for HDCP
Add binding changes for HDCP in the MHDP8546 DPI/DP bridge binding. Signed-off-by: Parshuram Thombare --- .../display/bridge/cdns,mhdp8546.yaml | 34 --- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/Documentation/devicetree/bindings/display/bridge/cdns,mhdp8546.yaml b/Documentation/devicetree/bindings/display/bridge/cdns,mhdp8546.yaml index 63427878715e..d571f4bb6b16 100644 --- a/Documentation/devicetree/bindings/display/bridge/cdns,mhdp8546.yaml +++ b/Documentation/devicetree/bindings/display/bridge/cdns,mhdp8546.yaml @@ -17,8 +17,8 @@ properties: - ti,j721e-mhdp8546 reg: -minItems: 1 -maxItems: 2 +minItems: 2 +maxItems: 3 items: - description: Register block of mhdptx apb registers up to PHY mapped area (AUX_CONFIG_P). @@ -26,13 +26,20 @@ properties: included in the associated PHY. - description: Register block for DSS_EDP0_INTG_CFG_VP registers in case of TI J7 SoCs. + - description: + Register block of mhdptx sapb registers. reg-names: -minItems: 1 -maxItems: 2 -items: - - const: mhdptx - - const: j721e-intg +minItems: 2 +maxItems: 3 +oneOf: + - items: + - const: mhdptx + - const: j721e-intg + - const: mhdptx-sapb + - items: + - const: mhdptx + - const: mhdptx-sapb clocks: maxItems: 1 @@ -98,15 +105,15 @@ allOf: then: properties: reg: - minItems: 2 + minItems: 3 reg-names: - minItems: 2 + minItems: 3 else: properties: reg: - maxItems: 1 + maxItems: 2 reg-names: - maxItems: 1 + maxItems: 2 required: - compatible @@ -129,8 +136,9 @@ examples: mhdp: dp-bridge@f0fb00 { compatible = "cdns,mhdp8546"; -reg = <0xf0 0xfb00 0x0 0x100>; -reg-names = "mhdptx"; +reg = <0xf0 0xfb00 0x0 0x100>, + <0x0 0x4f48000 0x0 0x74>; +reg-names = "mhdptx", "mhdptx-sapb"; clocks = <&mhdp_clock>; phys = <&dp_phy>; phy-names = "dpphy"; -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 2/2] drm: bridge: cdns-mhdp8546: Enable HDCP
This patch enable HDCP in MHDP driver. Signed-off-by: Parshuram Thombare Reviewed-by: Robert Foss --- drivers/gpu/drm/bridge/cadence/Makefile | 2 +- .../drm/bridge/cadence/cdns-mhdp8546-core.c | 113 +++- .../drm/bridge/cadence/cdns-mhdp8546-core.h | 21 + .../drm/bridge/cadence/cdns-mhdp8546-hdcp.c | 570 ++ .../drm/bridge/cadence/cdns-mhdp8546-hdcp.h | 92 +++ 5 files changed, 785 insertions(+), 13 deletions(-) create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.c create mode 100644 drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-hdcp.h diff --git a/drivers/gpu/drm/bridge/cadence/Makefile b/drivers/gpu/drm/bridge/cadence/Makefile index 8f647991b374..4d2db8df1bc6 100644 --- a/drivers/gpu/drm/bridge/cadence/Makefile +++ b/drivers/gpu/drm/bridge/cadence/Makefile @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_DRM_CDNS_MHDP8546) += cdns-mhdp8546.o -cdns-mhdp8546-y := cdns-mhdp8546-core.o +cdns-mhdp8546-y := cdns-mhdp8546-core.o cdns-mhdp8546-hdcp.o cdns-mhdp8546-$(CONFIG_DRM_CDNS_MHDP8546_J721E) += cdns-mhdp8546-j721e.o diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index d0c65610ebb5..d7e0e6a547b5 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,7 @@ #include #include "cdns-mhdp8546-core.h" - +#include "cdns-mhdp8546-hdcp.h" #include "cdns-mhdp8546-j721e.h" static int cdns_mhdp_mailbox_read(struct cdns_mhdp_device *mhdp) @@ -1614,10 +1615,47 @@ enum drm_mode_status cdns_mhdp_mode_valid(struct drm_connector *conn, return MODE_OK; } +static int cdns_mhdp_connector_atomic_check(struct drm_connector *conn, + struct drm_atomic_state *state) +{ + struct drm_connector_state *old_state, *new_state; + struct drm_crtc_state *crtc_state; + u64 old_cp, new_cp; + + old_state = drm_atomic_get_old_connector_state(state, conn); + new_state = drm_atomic_get_new_connector_state(state, conn); + old_cp = old_state->content_protection; + new_cp = new_state->content_protection; + + if (old_state->hdcp_content_type != new_state->hdcp_content_type && + new_cp != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) { + new_state->content_protection = DRM_MODE_CONTENT_PROTECTION_DESIRED; + goto mode_changed; + } + + if (!new_state->crtc) { + if (old_cp == DRM_MODE_CONTENT_PROTECTION_ENABLED) + new_state->content_protection = DRM_MODE_CONTENT_PROTECTION_DESIRED; + return 0; + } + + if (old_cp == new_cp || + (old_cp == DRM_MODE_CONTENT_PROTECTION_DESIRED && +new_cp == DRM_MODE_CONTENT_PROTECTION_ENABLED)) + return 0; + +mode_changed: + crtc_state = drm_atomic_get_new_crtc_state(state, new_state->crtc); + crtc_state->mode_changed = true; + + return 0; +} + static const struct drm_connector_helper_funcs cdns_mhdp_conn_helper_funcs = { .detect_ctx = cdns_mhdp_connector_detect, .get_modes = cdns_mhdp_get_modes, .mode_valid = cdns_mhdp_mode_valid, + .atomic_check = cdns_mhdp_connector_atomic_check, }; static const struct drm_connector_funcs cdns_mhdp_conn_funcs = { @@ -1662,7 +1700,7 @@ static int cdns_mhdp_connector_init(struct cdns_mhdp_device *mhdp) return ret; } - return 0; + return drm_connector_attach_content_protection_property(conn, true); } static int cdns_mhdp_attach(struct drm_bridge *bridge, @@ -1957,6 +1995,14 @@ static void cdns_mhdp_atomic_enable(struct drm_bridge *bridge, if (WARN_ON(!conn_state)) goto out; + if (mhdp->hw_state == MHDP_HW_READY && + conn_state->content_protection == + DRM_MODE_CONTENT_PROTECTION_DESIRED) { + mutex_unlock(&mhdp->link_mutex); + cdns_mhdp_hdcp_enable(mhdp, conn_state->hdcp_content_type); + mutex_lock(&mhdp->link_mutex); + } + crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc); if (WARN_ON(!crtc_state)) goto out; @@ -2000,6 +2046,7 @@ static void cdns_mhdp_atomic_disable(struct drm_bridge *bridge, mutex_lock(&mhdp->link_mutex); + cdns_mhdp_hdcp_disable(mhdp); mhdp->bridge_enabled = false; cdns_mhdp_reg_read(mhdp, CDNS_DP_FRAMER_GLOBAL_CONFIG, &resp); resp &= ~CDNS_DP_FRAMER_EN; @@ -2288,7 +2335,6 @@ static irqreturn_t cdns_mhdp_irq_handler(int irq, void *data) struct cdns_mhdp_device *mhdp = data; u32 apb_stat, sw_ev0; bool bridge_attached; - int ret; apb_stat = readl(mhdp->regs + CDNS_APB_INT_STATU
Re: [PATCH] drm/meson: Fix few typo
On 18/03/2021 12:00, Bhaskar Chowdhury wrote: > > s/initialy/initially/ > s/desined/designed/ > > Signed-off-by: Bhaskar Chowdhury > --- > drivers/gpu/drm/meson/meson_venc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/meson/meson_venc.c > b/drivers/gpu/drm/meson/meson_venc.c > index 5e2236ec189f..3c55ed003359 100644 > --- a/drivers/gpu/drm/meson/meson_venc.c > +++ b/drivers/gpu/drm/meson/meson_venc.c > @@ -45,7 +45,7 @@ > * The ENCI is designed for PAl or NTSC encoding and can go through the VDAC > * directly for CVBS encoding or through the ENCI_DVI encoder for HDMI. > * The ENCP is designed for Progressive encoding but can also generate > - * 1080i interlaced pixels, and was initialy desined to encode pixels for > + * 1080i interlaced pixels, and was initially designed to encode pixels for > * VDAC to output RGB ou YUV analog outputs. > * It's output is only used through the ENCP_DVI encoder for HDMI. > * The ENCL LVDS encoder is not implemented. > -- > 2.26.2 > Thanks, Applied to drm-misc-next Neil ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/3] drm/ttm: move swapout logic around
Hi "Christian, I love your patch! Perhaps something to improve: [auto build test WARNING on drm-tip/drm-tip] [also build test WARNING on next-20210319] [cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next tegra-drm/drm/tegra/for-next linus/master drm/drm-next v5.12-rc3] [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/Christian-K-nig/drm-ttm-move-swapout-logic-around/20210316-000551 base: git://anongit.freedesktop.org/drm/drm-tip drm-tip config: x86_64-randconfig-a005-20210318 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project fcc1ce00931751ac02498986feb37744e9ace8de) 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/824dca26fe395899b41d9790944ddea345f7a6fd git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Christian-K-nig/drm-ttm-move-swapout-logic-around/20210316-000551 git checkout 824dca26fe395899b41d9790944ddea345f7a6fd # 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/ttm/ttm_device.c:42: warning: Function parameter or member 'ttm_global_mutex' not described in 'DEFINE_MUTEX' drivers/gpu/drm/ttm/ttm_device.c:42: warning: expecting prototype for ttm_global_mutex(). Prototype was for DEFINE_MUTEX() instead drivers/gpu/drm/ttm/ttm_device.c:110: warning: Function parameter or member 'ctx' not described in 'ttm_global_swapout' drivers/gpu/drm/ttm/ttm_device.c:110: warning: Function parameter or member 'gfp_flags' not described in 'ttm_global_swapout' >> drivers/gpu/drm/ttm/ttm_device.c:110: warning: expecting prototype for A >> buffer object shrink method that tries to swap out the first(). Prototype >> was for ttm_global_swapout() instead vim +110 drivers/gpu/drm/ttm/ttm_device.c 104 105 /** 106 * A buffer object shrink method that tries to swap out the first 107 * buffer object on the global::swap_lru list. 108 */ 109 long ttm_global_swapout(struct ttm_operation_ctx *ctx, gfp_t gfp_flags) > 110 { 111 struct ttm_global *glob = &ttm_glob; 112 struct ttm_buffer_object *bo; 113 unsigned i; 114 int ret; 115 116 spin_lock(&glob->lru_lock); 117 for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) { 118 list_for_each_entry(bo, &glob->swap_lru[i], swap) { 119 uint32_t num_pages = bo->ttm->num_pages; 120 121 ret = ttm_bo_swapout(bo, ctx, gfp_flags); 122 /* ttm_bo_swapout has dropped the lru_lock */ 123 if (!ret) 124 return num_pages; 125 if (ret != -EBUSY) 126 return ret; 127 } 128 } 129 spin_unlock(&glob->lru_lock); 130 return 0; 131 } 132 EXPORT_SYMBOL(ttm_global_swapout); 133 --- 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 1/3] drm/ttm: move swapout logic around v2
On Thu, 18 Mar 2021 at 12:47, Christian König wrote: > > Move the iteration of the global lru into the new function > ttm_global_swapout() and use that instead in drivers. > > v2: consistently return int > > Signed-off-by: Christian König For the series, Reviewed-by: Matthew Auld ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/18] drm/bridge: Add HDMI output fmt helper
On 18/03/2021 19:31, Jernej Škrabec wrote: > Dne sreda, 17. marec 2021 ob 17:08:07 CET je Neil Armstrong napisal(a): >> On 17/03/2021 16:43, Maxime Ripard wrote: >>> The atomic_get_output_bus_fmts bridge callback is there to list the >>> available formats for output by decreasing order of preference. >>> >>> On HDMI controllers, we have a fairly static list that will depend on >>> what the HDMI sink is capable of and the BPC our controller can output. >>> >>> The dw-hdmi driver already has that code done in a fairly generic >>> manner, so let's turn that code into an helper for all the HDMI >>> controllers to reuse. >> >> This code was based on the capabilities of the DW-HDMI IP, copying it as-is >> doesn't make much sense, we should be able to filter out formats the HDMI IP >> doesn't support. > > HDMI standard has pretty strict requirements which formats should be > supported, so cores should have very similar capabilities. Yes for output formats (we still may need to filter out 420, 422 for example), No for input formats, since it depends entirely on the capability of the transceiver in terms of format conversion. Neil > > Best regards, > Jernej > > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH V3] drm/ast: Disable fast reset after DRAM initial
[Bug][AST2500] V1: When AST2500 acts as stand-alone VGA so that DRAM and DVO initialization have to be achieved by VGA driver with P2A (PCI to AHB) enabling. However, HW suggests disable Fast reset mode after DRAM initializaton, because fast reset mode is mainly designed for ARM ICE debugger. Once Fast reset is checked as enabling, WDT (Watch Dog Timer) should be first enabled to avoid system deadlock before disable fast reset mode. V2: Use to_pci_dev() to get revision of PCI configuration. V3: If SCU00 is not unlocked, just enter its password again. It is unnecessary to clear AHB lock condition and restore WDT default setting again, before Fast-reset clearing. Signed-off-by: KuoHsiang Chou --- drivers/gpu/drm/ast/ast_drv.h | 1 + drivers/gpu/drm/ast/ast_main.c | 5 +++ drivers/gpu/drm/ast/ast_post.c | 68 +- 3 files changed, 48 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h index da6dfb677540..a2cf5fef2399 100644 --- a/drivers/gpu/drm/ast/ast_drv.h +++ b/drivers/gpu/drm/ast/ast_drv.h @@ -320,6 +320,7 @@ bool ast_is_vga_enabled(struct drm_device *dev); void ast_post_gpu(struct drm_device *dev); u32 ast_mindwm(struct ast_private *ast, u32 r); void ast_moutdwm(struct ast_private *ast, u32 r, u32 v); +void ast_patch_ahb_2500(struct ast_private *ast); /* ast dp501 */ void ast_set_dp501_video_output(struct drm_device *dev, u8 mode); bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size); diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index 3775fe26f792..0e4dfcc25623 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -69,6 +69,7 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) { struct device_node *np = dev->pdev->dev.of_node; struct ast_private *ast = to_ast_private(dev); + struct pci_dev *pdev = to_pci_dev(dev->dev); uint32_t data, jregd0, jregd1; /* Defaults */ @@ -96,6 +97,10 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev) jregd0 = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd0, 0xff); jregd1 = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd1, 0xff); if (!(jregd0 & 0x80) || !(jregd1 & 0x10)) { + /* Patch AST2500 */ + if (((pdev->revision & 0xF0) == 0x40) && ((jregd0 & 0xC0) == 0)) + ast_patch_ahb_2500(ast); + /* Double check it's actually working */ data = ast_read32(ast, 0xf004); if (data != 0x) { diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c index 8902c2f84bf9..4f194c5fd2c2 100644 --- a/drivers/gpu/drm/ast/ast_post.c +++ b/drivers/gpu/drm/ast/ast_post.c @@ -2026,6 +2026,30 @@ static bool ast_dram_init_2500(struct ast_private *ast) return true; } +void ast_patch_ahb_2500(struct ast_private *ast) +{ + u32 data; + + /* Clear bus lock condition */ + ast_moutdwm(ast, 0x1e60, 0xAEED1A03); + ast_moutdwm(ast, 0x1e600084, 0x0001); + ast_moutdwm(ast, 0x1e600088, 0x); + ast_moutdwm(ast, 0x1e6e2000, 0x1688A8A8); + data = ast_mindwm(ast, 0x1e6e2070); + if (data & 0x0800) {/* check fast reset */ + + ast_moutdwm(ast, 0x1E785004, 0x0010); + ast_moutdwm(ast, 0x1E785008, 0x4755); + ast_moutdwm(ast, 0x1E78500c, 0x0033); + udelay(1000); + } + do { + ast_moutdwm(ast, 0x1e6e2000, 0x1688A8A8); + data = ast_mindwm(ast, 0x1e6e2000); + } while (data != 1); + ast_moutdwm(ast, 0x1e6e207c, 0x0800); /* clear fast reset */ +} + void ast_post_chip_2500(struct drm_device *dev) { struct ast_private *ast = to_ast_private(dev); @@ -2033,39 +2057,31 @@ void ast_post_chip_2500(struct drm_device *dev) u8 reg; reg = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xd0, 0xff); - if ((reg & 0x80) == 0) {/* vga only */ + if ((reg & 0xC0) == 0) {/* vga only */ /* Clear bus lock condition */ - ast_moutdwm(ast, 0x1e60, 0xAEED1A03); - ast_moutdwm(ast, 0x1e600084, 0x0001); - ast_moutdwm(ast, 0x1e600088, 0x); - ast_moutdwm(ast, 0x1e6e2000, 0x1688A8A8); - ast_write32(ast, 0xf004, 0x1e6e); - ast_write32(ast, 0xf000, 0x1); - ast_write32(ast, 0x12000, 0x1688a8a8); - while (ast_read32(ast, 0x12000) != 0x1) - ; - - ast_write32(ast, 0x1, 0xfc600309); - while (ast_read32(ast, 0x1) != 0x1) - ; + ast_patch_ahb_2500(ast); + + /* Disable watchdog */ + ast_moutdwm(ast, 0x1E78502
Re: [PATCH 01/19] drm/nouveau/nvkm/subdev/bios/init: Demote obvious abuse of kernel-doc
Reviewed-by: Karol Herbst On Fri, Mar 19, 2021 at 9:24 AM Lee Jones wrote: > > Fixes the following W=1 kernel build warning(s): > > drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:584: warning: Function > parameter or member 'init' not described in 'init_reserved' > drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:611: warning: Function > parameter or member 'init' not described in 'init_done' > drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:622: warning: Function > parameter or member 'init' not described in 'init_io_restrict_prog' > drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:659: warning: Function > parameter or member 'init' not described in 'init_repeat' > drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:685: warning: Function > parameter or member 'init' not described in 'init_io_restrict_pll' > drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c:725: warning: Function > parameter or member 'init' not described in 'init_end_repeat' > > NB: Trimmed for brevity (lots of these!) > > Cc: Ben Skeggs > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Signed-off-by: Lee Jones > --- > .../gpu/drm/nouveau/nvkm/subdev/bios/init.c | 204 ++ > 1 file changed, 68 insertions(+), 136 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c > index 9de74f41dcd2a..5a91dc4e5c8ec 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c > @@ -575,9 +575,8 @@ init_tmds_reg(struct nvbios_init *init, u8 tmds) > * init opcode handlers > > */ > > -/** > +/* > * init_reserved - stub for various unknown/unused single-byte opcodes > - * > */ > static void > init_reserved(struct nvbios_init *init) > @@ -602,9 +601,8 @@ init_reserved(struct nvbios_init *init) > init->offset += length; > } > > -/** > +/* > * INIT_DONE - opcode 0x71 > - * > */ > static void > init_done(struct nvbios_init *init) > @@ -613,9 +611,8 @@ init_done(struct nvbios_init *init) > init->offset = 0x; > } > > -/** > +/* > * INIT_IO_RESTRICT_PROG - opcode 0x32 > - * > */ > static void > init_io_restrict_prog(struct nvbios_init *init) > @@ -650,9 +647,8 @@ init_io_restrict_prog(struct nvbios_init *init) > trace("}]\n"); > } > > -/** > +/* > * INIT_REPEAT - opcode 0x33 > - * > */ > static void > init_repeat(struct nvbios_init *init) > @@ -676,9 +672,8 @@ init_repeat(struct nvbios_init *init) > init->repeat = repeat; > } > > -/** > +/* > * INIT_IO_RESTRICT_PLL - opcode 0x34 > - * > */ > static void > init_io_restrict_pll(struct nvbios_init *init) > @@ -716,9 +711,8 @@ init_io_restrict_pll(struct nvbios_init *init) > trace("}]\n"); > } > > -/** > +/* > * INIT_END_REPEAT - opcode 0x36 > - * > */ > static void > init_end_repeat(struct nvbios_init *init) > @@ -732,9 +726,8 @@ init_end_repeat(struct nvbios_init *init) > } > } > > -/** > +/* > * INIT_COPY - opcode 0x37 > - * > */ > static void > init_copy(struct nvbios_init *init) > @@ -759,9 +752,8 @@ init_copy(struct nvbios_init *init) > init_wrvgai(init, port, index, data); > } > > -/** > +/* > * INIT_NOT - opcode 0x38 > - * > */ > static void > init_not(struct nvbios_init *init) > @@ -771,9 +763,8 @@ init_not(struct nvbios_init *init) > init_exec_inv(init); > } > > -/** > +/* > * INIT_IO_FLAG_CONDITION - opcode 0x39 > - * > */ > static void > init_io_flag_condition(struct nvbios_init *init) > @@ -788,9 +779,8 @@ init_io_flag_condition(struct nvbios_init *init) > init_exec_set(init, false); > } > > -/** > +/* > * INIT_GENERIC_CONDITION - opcode 0x3a > - * > */ > static void > init_generic_condition(struct nvbios_init *init) > @@ -840,9 +830,8 @@ init_generic_condition(struct nvbios_init *init) > } > } > > -/** > +/* > * INIT_IO_MASK_OR - opcode 0x3b > - * > */ > static void > init_io_mask_or(struct nvbios_init *init) > @@ -859,9 +848,8 @@ init_io_mask_or(struct nvbios_init *init) > init_wrvgai(init, 0x03d4, index, data &= ~(1 << or)); > } > > -/** > +/* > * INIT_IO_OR - opcode 0x3c > - * > */ > static void > init_io_or(struct nvbios_init *init) > @@ -878,9 +866,8 @@ init_io_or(struct nvbios_init *init) > init_wrvgai(init, 0x03d4, index, data | (1 << or)); > } > > -/** > +/* > * INIT_ANDN_REG - opcode 0x47 > - * > */ > static void > init_andn_reg(struct nvbios_init *init) > @@ -895,9 +882,8 @@ init_andn_reg(struct nvbios_init *init) > init_mask(init, reg, mask, 0); > } > > -/** > +/* > * INIT_OR_REG - opcode 0x48 > - * > */ > static void > init_or_reg(struct nvbios_init *init) > @@ -912,9 +898,8 @@ init_or_reg(struct nvbios_init *init) > init_mask(init, reg, 0, mask); > } > > -/** > +/* >
Re: [PATCH 05/19] drm/nouveau/nvkm/subdev/volt/gk20a: Demote non-conformant kernel-doc headers
On Fri, Mar 19, 2021 at 9:24 AM Lee Jones wrote: > > Fixes the following W=1 kernel build warning(s): > > drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:53: warning: Function > parameter or member 'speedo' not described in 'gk20a_volt_get_cvb_voltage' > drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:53: warning: Function > parameter or member 's_scale' not described in 'gk20a_volt_get_cvb_voltage' > drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:53: warning: Function > parameter or member 'coef' not described in 'gk20a_volt_get_cvb_voltage' > drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:69: warning: Function > parameter or member 'speedo' not described in 'gk20a_volt_get_cvb_t_voltage' > drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:69: warning: Function > parameter or member 'temp' not described in 'gk20a_volt_get_cvb_t_voltage' > drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:69: warning: Function > parameter or member 's_scale' not described in 'gk20a_volt_get_cvb_t_voltage' > drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:69: warning: Function > parameter or member 't_scale' not described in 'gk20a_volt_get_cvb_t_voltage' > drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c:69: warning: Function > parameter or member 'coef' not described in 'gk20a_volt_get_cvb_t_voltage' > > Cc: Ben Skeggs > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Signed-off-by: Lee Jones > --- > drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c > b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c > index 8c2faa9645111..ccac88da88648 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c > @@ -45,7 +45,7 @@ static const struct cvb_coef gk20a_cvb_coef[] = { > /* 852 */ { 1608418, -21643, -269, 0,763, -48}, > }; > > -/** > +/* > * cvb_mv = ((c2 * speedo / s_scale + c1) * speedo / s_scale + c0) > */ > static inline int > @@ -58,7 +58,7 @@ gk20a_volt_get_cvb_voltage(int speedo, int s_scale, const > struct cvb_coef *coef) > return mv; > } > > -/** > +/* > * cvb_t_mv = > * ((c2 * speedo / s_scale + c1) * speedo / s_scale + c0) + > * ((c3 * speedo / s_scale + c4 + c5 * T / t_scale) * T / t_scale) > -- > 2.27.0 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel > Reviewed-by: Karol Herbst ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 09/19] drm/nouveau/nvkm/engine/gr/gf100: Demote non-conformant kernel-doc header
On Fri, Mar 19, 2021 at 9:25 AM Lee Jones wrote: > > Fixes the following W=1 kernel build warning(s): > > drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c:992: warning: Function > parameter or member 'gr' not described in 'gf100_gr_wait_idle' > > Cc: Ben Skeggs > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Signed-off-by: Lee Jones > --- > drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c > b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c > index 397ff4fe9df89..69e6008f99196 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c > +++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c > @@ -982,7 +982,7 @@ gf100_gr_zbc_init(struct gf100_gr *gr) > } > } > > -/** > +/* > * Wait until GR goes idle. GR is considered idle if it is disabled by the > * MC (0x200) register, or GR is not busy and a context switch is not in > * progress. > -- > 2.27.0 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel > Reviewed-by: Karol Herbst ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 15/19] drm/nouveau/nv50_display: Remove superfluous prototype for local static functions
On Fri, Mar 19, 2021 at 9:25 AM Lee Jones wrote: > > Fixes the following build error: > > drivers/gpu/drm/nouveau/dispnv50/disp.c:2530:1: error: conflicting types for > ‘nv50_display_fini’ > In file included from drivers/gpu/drm/nouveau/dispnv50/disp.c:71: > drivers/gpu/drm/nouveau/nv50_display.h:36:6: note: previous declaration of > ‘nv50_display_fini’ was her > In file included from drivers/gpu/drm/nouveau/dispnv50/disp.c:71: > drivers/gpu/drm/nouveau/nv50_display.h:35:6: note: previous declaration of > ‘nv50_display_init’ was here > drivers/gpu/drm/nouveau/dispnv50/disp.c:2581:1: error: static declaration of > ‘nv50_display_destroy’ follows non-static declaration > In file included from drivers/gpu/drm/nouveau/dispnv50/disp.c:71: > drivers/gpu/drm/nouveau/nv50_display.h:34:6: note: previous declaration of > ‘nv50_display_destroy’ was here > > Cc: Ben Skeggs > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Signed-off-by: Lee Jones > --- > drivers/gpu/drm/nouveau/nv50_display.h | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nv50_display.h > b/drivers/gpu/drm/nouveau/nv50_display.h > index fbd3b15583bc8..2421401d12636 100644 > --- a/drivers/gpu/drm/nouveau/nv50_display.h > +++ b/drivers/gpu/drm/nouveau/nv50_display.h > @@ -31,7 +31,4 @@ > #include "nouveau_reg.h" > > int nv50_display_create(struct drm_device *); > -void nv50_display_destroy(struct drm_device *); > -int nv50_display_init(struct drm_device *); > -void nv50_display_fini(struct drm_device *); > #endif /* __NV50_DISPLAY_H__ */ > -- > 2.27.0 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel Reviewed-by: Karol Herbst ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 10/19] drm/nouveau/nouveau_bo: Remove unused variables 'dev'
On Fri, Mar 19, 2021 at 9:25 AM Lee Jones wrote: > > Fixes the following W=1 kernel build warning(s): > > drivers/gpu/drm/nouveau/nouveau_bo.c: In function ‘nouveau_ttm_tt_populate’: > drivers/gpu/drm/nouveau/nouveau_bo.c:1228:17: warning: variable ‘dev’ set > but not used [-Wunused-but-set-variable] > drivers/gpu/drm/nouveau/nouveau_bo.c: In function > ‘nouveau_ttm_tt_unpopulate’: > drivers/gpu/drm/nouveau/nouveau_bo.c:1252:17: warning: variable ‘dev’ set > but not used [-Wunused-but-set-variable] > > Cc: Ben Skeggs > Cc: David Airlie > Cc: Daniel Vetter > Cc: Sumit Semwal > Cc: "Christian König" > Cc: Jeremy Kolb > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Cc: linux-me...@vger.kernel.org > Cc: linaro-mm-...@lists.linaro.org > Signed-off-by: Lee Jones > --- > drivers/gpu/drm/nouveau/nouveau_bo.c | 4 > 1 file changed, 4 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c > b/drivers/gpu/drm/nouveau/nouveau_bo.c > index 281e9ed139895..913035ab85ec2 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_bo.c > +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c > @@ -1250,7 +1250,6 @@ nouveau_ttm_tt_populate(struct ttm_device *bdev, > { > struct ttm_tt *ttm_dma = (void *)ttm; > struct nouveau_drm *drm; > - struct device *dev; > bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); > > if (ttm_tt_is_populated(ttm)) > @@ -1263,7 +1262,6 @@ nouveau_ttm_tt_populate(struct ttm_device *bdev, > } > > drm = nouveau_bdev(bdev); > - dev = drm->dev->dev; > > return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx); > } > @@ -1273,14 +1271,12 @@ nouveau_ttm_tt_unpopulate(struct ttm_device *bdev, > struct ttm_tt *ttm) > { > struct nouveau_drm *drm; > - struct device *dev; > bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); > > if (slave) > return; > > drm = nouveau_bdev(bdev); > - dev = drm->dev->dev; > > return ttm_pool_free(&drm->ttm.bdev.pool, ttm); > } > -- > 2.27.0 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel Reviewed-by: Karol Herbst ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 19/19] drm/nouveau/nouveau_ioc32: Demote kernel-doc abuse to standard comment block
On Fri, Mar 19, 2021 at 9:25 AM Lee Jones wrote: > > Fixes the following W=1 kernel build warning(s): > > drivers/gpu/drm/nouveau/nouveau_ioc32.c:52: warning: Function parameter or > member 'filp' not described in 'nouveau_compat_ioctl' > drivers/gpu/drm/nouveau/nouveau_ioc32.c:52: warning: Function parameter or > member 'cmd' not described in 'nouveau_compat_ioctl' > drivers/gpu/drm/nouveau/nouveau_ioc32.c:52: warning: Function parameter or > member 'arg' not described in 'nouveau_compat_ioctl' > > Cc: Ben Skeggs > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Signed-off-by: Lee Jones > --- > drivers/gpu/drm/nouveau/nouveau_ioc32.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_ioc32.c > b/drivers/gpu/drm/nouveau/nouveau_ioc32.c > index 8ddf9b2325a42..2af3615c5205c 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_ioc32.c > +++ b/drivers/gpu/drm/nouveau/nouveau_ioc32.c > @@ -38,7 +38,7 @@ > > #include "nouveau_ioctl.h" > > -/** > +/* > * Called whenever a 32-bit process running under a 64-bit kernel > * performs an ioctl on /dev/dri/card. > * > -- > 2.27.0 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel > Reviewed-by: Karol Herbst ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 17/19] drm/nouveau/nouveau_ioc32: File headers are not good candidates for kernel-doc
On Fri, Mar 19, 2021 at 9:25 AM Lee Jones wrote: > > Fixes the following W=1 kernel build warning(s): > > drivers/gpu/drm/nouveau/nouveau_ioc32.c:2: warning: Cannot understand * > file mga_ioc32.c > > Cc: Ben Skeggs > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Signed-off-by: Lee Jones > --- > drivers/gpu/drm/nouveau/nouveau_ioc32.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_ioc32.c > b/drivers/gpu/drm/nouveau/nouveau_ioc32.c > index adf01ca9e035d..8ddf9b2325a42 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_ioc32.c > +++ b/drivers/gpu/drm/nouveau/nouveau_ioc32.c > @@ -1,4 +1,4 @@ > -/** > +/* > * \file mga_ioc32.c > * > * 32-bit ioctl compatibility routines for the MGA DRM. > -- > 2.27.0 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel > Reviewed-by: Karol Herbst ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 12/19] drm/nouveau/dispnv04/crtc: Demote non-conforming kernel-doc headers
On Fri, Mar 19, 2021 at 9:25 AM Lee Jones wrote: > > Fixes the following W=1 kernel build warning(s): > > drivers/gpu/drm/nouveau/dispnv04/crtc.c:462: warning: Function parameter or > member 'crtc' not described in 'nv_crtc_mode_set_regs' > drivers/gpu/drm/nouveau/dispnv04/crtc.c:462: warning: Function parameter or > member 'mode' not described in 'nv_crtc_mode_set_regs' > drivers/gpu/drm/nouveau/dispnv04/crtc.c:640: warning: Function parameter or > member 'crtc' not described in 'nv_crtc_mode_set' > drivers/gpu/drm/nouveau/dispnv04/crtc.c:640: warning: Function parameter or > member 'mode' not described in 'nv_crtc_mode_set' > drivers/gpu/drm/nouveau/dispnv04/crtc.c:640: warning: Function parameter or > member 'adjusted_mode' not described in 'nv_crtc_mode_set' > drivers/gpu/drm/nouveau/dispnv04/crtc.c:640: warning: Function parameter or > member 'x' not described in 'nv_crtc_mode_set' > drivers/gpu/drm/nouveau/dispnv04/crtc.c:640: warning: Function parameter or > member 'y' not described in 'nv_crtc_mode_set' > drivers/gpu/drm/nouveau/dispnv04/crtc.c:640: warning: Function parameter or > member 'old_fb' not described in 'nv_crtc_mode_set' > > Cc: Ben Skeggs > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Signed-off-by: Lee Jones > --- > drivers/gpu/drm/nouveau/dispnv04/crtc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c > b/drivers/gpu/drm/nouveau/dispnv04/crtc.c > index f9e962fd94d0d..f9a276ea5a9e0 100644 > --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c > +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c > @@ -449,7 +449,7 @@ nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct > drm_display_mode *mode) > regp->Attribute[NV_CIO_AR_CSEL_INDEX] = 0x00; > } > > -/** > +/* > * Sets up registers for the given mode/adjusted_mode pair. > * > * The clocks, CRTCs and outputs attached to this CRTC must be off. > @@ -625,7 +625,7 @@ nv_crtc_swap_fbs(struct drm_crtc *crtc, struct > drm_framebuffer *old_fb) > return ret; > } > > -/** > +/* > * Sets up registers for the given mode/adjusted_mode pair. > * > * The clocks, CRTCs and outputs attached to this CRTC must be off. > -- > 2.27.0 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel > Reviewed-by: Karol Herbst ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 14/19] drm/nouveau/dispnv50/headc57d: Make local function 'headc57d_olut' static
On Fri, Mar 19, 2021 at 9:25 AM Lee Jones wrote: > > Fixes the following W=1 kernel build warning(s): > > drivers/gpu/drm/nouveau/dispnv50/headc57d.c:173:1: warning: no previous > prototype for ‘headc57d_olut’ [-Wmissing-prototypes] > > Cc: Ben Skeggs > Cc: David Airlie > Cc: Daniel Vetter > Cc: Lyude Paul > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Signed-off-by: Lee Jones > --- > drivers/gpu/drm/nouveau/dispnv50/headc57d.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/dispnv50/headc57d.c > b/drivers/gpu/drm/nouveau/dispnv50/headc57d.c > index fd51527b56b83..bdcfd240d61c8 100644 > --- a/drivers/gpu/drm/nouveau/dispnv50/headc57d.c > +++ b/drivers/gpu/drm/nouveau/dispnv50/headc57d.c > @@ -169,7 +169,7 @@ headc57d_olut_load(struct drm_color_lut *in, int size, > void __iomem *mem) > writew(readw(mem - 4), mem + 4); > } > > -bool > +static bool > headc57d_olut(struct nv50_head *head, struct nv50_head_atom *asyh, int size) > { > if (size != 0 && size != 256 && size != 1024) > -- > 2.27.0 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel Reviewed-by: Karol Herbst ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/18] drm/bridge: Add HDMI output fmt helper
On Fri, Mar 19, 2021 at 10:44:56AM +0100, Neil Armstrong wrote: > On 18/03/2021 19:31, Jernej Škrabec wrote: > > Dne sreda, 17. marec 2021 ob 17:08:07 CET je Neil Armstrong napisal(a): > >> On 17/03/2021 16:43, Maxime Ripard wrote: > >>> The atomic_get_output_bus_fmts bridge callback is there to list the > >>> available formats for output by decreasing order of preference. > >>> > >>> On HDMI controllers, we have a fairly static list that will depend on > >>> what the HDMI sink is capable of and the BPC our controller can output. > >>> > >>> The dw-hdmi driver already has that code done in a fairly generic > >>> manner, so let's turn that code into an helper for all the HDMI > >>> controllers to reuse. > >> > >> This code was based on the capabilities of the DW-HDMI IP, copying it as-is > >> doesn't make much sense, we should be able to filter out formats the HDMI > >> IP > >> doesn't support. > > > > HDMI standard has pretty strict requirements which formats should be > > supported, so cores should have very similar capabilities. > > Yes for output formats (we still may need to filter out 420, 422 for example), > > No for input formats, since it depends entirely on the capability of the > transceiver > in terms of format conversion. Yeah, of course, that's why I only moved the output part to a generic helper :) We indeed might need to provide additional filtering to the output though 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] drm: i915: Fix a typo
On Fri, 19 Mar 2021, Bhaskar Chowdhury wrote: > s/nothign/nothing/ > > Signed-off-by: Bhaskar Chowdhury Thanks, pushed. BR, Jani. > --- > drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c > b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c > index f6ad257a260e..14d784a6fae5 100644 > --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c > +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c > @@ -4185,7 +4185,7 @@ static void icl_pll_disable(struct drm_i915_private > *dev_priv, > /* >* DVFS pre sequence would be here, but in our driver the cdclk code >* paths should already be setting the appropriate voltage, hence we do > - * nothign here. > + * nothing here. >*/ > > val = intel_de_read(dev_priv, enable_reg); > -- > 2.26.2 > -- Jani Nikula, Intel Open Source Graphics Center ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 00/18] drm/vc4: hdmi: Add Support for the YUV output
Hi Jernej, On Thu, Mar 18, 2021 at 07:16:33PM +0100, Jernej Škrabec wrote: > Dne sreda, 17. marec 2021 ob 16:43:34 CET je Maxime Ripard napisal(a): > > Hi, > > > > Here's an attempt at support the HDMI YUV output on the BCM2711 SoC found on > > the RaspberryPi4. > > > > I took the same approach than what dw-hdmi did already, turning a bunch of > > functions found in that driver into helpers since they were fairly generic. > > > > However, it feels a bit clunky overall and there's a few rough edges that > > should be addressed in a generic manner: > > > > - while the format negociation makes sense for a bridge, it feels a bit > > over-engineered for a simple encoder where that setting could be a > simple > > switch (and possibly a property?) > > Property could work, but possible values should be then limited to cross > section of HW and connected display capabilities. That's a good point. I'm not sure if the userspace should expect the list of values of an enum to change under its feet > > - more importantly, whether we're choosing an YUV output or not is > > completely hidden away from the userspace even though it might > > have some effect on > the visual quality output (thinking about > > YUV420 and YUV422 here mostly). > > IMO driver should select highest achievable quality. So in case of > YUV420 and YUV422, later should be selected. This should be the case > even if the property is implemented. Well, it depends on the hardware capability. On RPi4 in some situations (high bpc count), we can't output anything else than YUV422. I'd expect to have some way for the userspace to know at least. And then, for subsampling formats it's fairly easy to tell which is the highest achievable quality, but it would be pretty hard for YUV444 vs RGB? 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 18/30] drm/print: Fixup DRM_DEBUG_KMS_RATELIMITED()
Hey Lyude, Thanks for the patch, On Fri, 19 Feb 2021 at 22:59, Lyude Paul wrote: > > Since we're about to move drm_dp_helper.c over to drm_dbg_*(), we'll want > to make sure that we can also add ratelimited versions of these macros in > order to retain some of the previous debugging output behavior we had. > > However, as I was preparing to do this I noticed that the current > rate limited macros we have are kind of bogus. It looks like when I wrote > these, I didn't notice that we'd always be calling __ratelimit() even if > the debugging message we'd be printing would normally be filtered out due > to the relevant DRM debugging category being disabled. > > So, let's fix this by making sure to check drm_debug_enabled() in our > ratelimited macros before calling __ratelimit(), and start using > drm_dev_printk() in order to print debugging messages since that will save > us from doing a redundant drm_debug_enabled() check. And while we're at it, > let's move the code for this into another macro that we can reuse for > defining new ratelimited DRM debug macros more easily. > > Signed-off-by: Lyude Paul > --- > include/drm/drm_print.h | 20 > 1 file changed, 12 insertions(+), 8 deletions(-) > > diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h > index f32d179e139d..3a0c3fe4d292 100644 > --- a/include/drm/drm_print.h > +++ b/include/drm/drm_print.h > @@ -524,16 +524,20 @@ void __drm_err(const char *format, ...); > #define DRM_DEBUG_DP(fmt, ...) \ > __drm_dbg(DRM_UT_DP, fmt, ## __VA_ARGS__) > > - > -#define DRM_DEBUG_KMS_RATELIMITED(fmt, ...)\ > -({ \ > - static DEFINE_RATELIMIT_STATE(_rs, \ > - DEFAULT_RATELIMIT_INTERVAL, \ > - DEFAULT_RATELIMIT_BURST); \ > - if (__ratelimit(&_rs)) \ > - drm_dev_dbg(NULL, DRM_UT_KMS, fmt, ##__VA_ARGS__); \ > +#define __DRM_DEFINE_DBG_RATELIMITED(category, drm, fmt, ...) > \ > +({ > \ > + static DEFINE_RATELIMIT_STATE(rs_, DEFAULT_RATELIMIT_INTERVAL, > DEFAULT_RATELIMIT_BURST); \ > + const struct drm_device *drm_ = (drm); >\ > + > \ > + if (drm_debug_enabled(DRM_UT_ ## category) && __ratelimit(&rs_)) >\ > + drm_dev_printk(drm_ ? drm_->dev : NULL, KERN_DEBUG, fmt, ## > __VA_ARGS__);\ > }) checkpatch --strict is unhappy about the tabs/spaces in this patch ERROR: code indent should use tabs where possible #48: FILE: include/drm/drm_print.h:531: + \$ WARNING: please, no spaces at the start of a line #48: FILE: include/drm/drm_print.h:531: + \$ > > +#define drm_dbg_kms_ratelimited(drm, fmt, ...) \ > + __DRM_DEFINE_DBG_RATELIMITED(KMS, drm, fmt, ## __VA_ARGS__) > + > +#define DRM_DEBUG_KMS_RATELIMITED(fmt, ...) drm_dbg_kms_ratelimited(NULL, > fmt, ## __VA_ARGS__) > + > /* > * struct drm_device based WARNs > * > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 27/30] drm/dp_mst: Pass drm_dp_mst_topology_mgr to drm_dp_get_vc_payload_bw()
Hey Lyude, Thanks for the patch. On Fri, 19 Feb 2021 at 23:03, Lyude Paul wrote: > > Since this is one of the few functions in drm_dp_mst_topology.c that > doesn't have any way of getting access to a drm_device, let's pass the > drm_dp_mst_topology_mgr down to this function so that it can use > drm_dbg_kms(). > > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/drm_dp_mst_topology.c | 7 +-- > drivers/gpu/drm/i915/display/intel_dp_mst.c | 3 ++- > include/drm/drm_dp_mst_helper.h | 3 ++- > 3 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c > b/drivers/gpu/drm/drm_dp_mst_topology.c > index cf4f2f85711e..fb66df39e0bb 100644 > --- a/drivers/gpu/drm/drm_dp_mst_topology.c > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c > @@ -3631,6 +3631,7 @@ static int drm_dp_send_up_ack_reply(struct > drm_dp_mst_topology_mgr *mgr, > > /** > * drm_dp_get_vc_payload_bw - get the VC payload BW for an MST link > + * @mgr: The &drm_dp_mst_topology_mgr to use > * @link_rate: link rate in 10kbits/s units > * @link_lane_count: lane count > * > @@ -3639,7 +3640,8 @@ static int drm_dp_send_up_ack_reply(struct > drm_dp_mst_topology_mgr *mgr, > * convert the number of PBNs required for a given stream to the number of > * timeslots this stream requires in each MTP. > */ > -int drm_dp_get_vc_payload_bw(int link_rate, int link_lane_count) > +int drm_dp_get_vc_payload_bw(const struct drm_dp_mst_topology_mgr *mgr, > +int link_rate, int link_lane_count) > { > if (link_rate == 0 || link_lane_count == 0) > DRM_DEBUG_KMS("invalid link rate/lane count: (%d / %d)\n", > @@ -3704,7 +3706,8 @@ int drm_dp_mst_topology_mgr_set_mst(struct > drm_dp_mst_topology_mgr *mgr, bool ms > goto out_unlock; > } > > - mgr->pbn_div = > drm_dp_get_vc_payload_bw(drm_dp_bw_code_to_link_rate(mgr->dpcd[1]), > + mgr->pbn_div = drm_dp_get_vc_payload_bw(mgr, > + > drm_dp_bw_code_to_link_rate(mgr->dpcd[1]), > mgr->dpcd[2] & > DP_MAX_LANE_COUNT_MASK); > if (mgr->pbn_div == 0) { > ret = -EINVAL; > diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c > b/drivers/gpu/drm/i915/display/intel_dp_mst.c > index 8e316146b6d1..60ca0fa32d15 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c > +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c > @@ -70,7 +70,8 @@ static int intel_dp_mst_compute_link_config(struct > intel_encoder *encoder, > slots = drm_dp_atomic_find_vcpi_slots(state, > &intel_dp->mst_mgr, > connector->port, > crtc_state->pbn, > - > drm_dp_get_vc_payload_bw(crtc_state->port_clock, > + > drm_dp_get_vc_payload_bw(&intel_dp->mst_mgr, > + > crtc_state->port_clock, > > crtc_state->lane_count)); checkpatch --strict is unhappy about this chunk WARNING: line length of 102 exceeds 100 columns #61: FILE: drivers/gpu/drm/i915/display/intel_dp_mst.c:73: + crtc_state->port_clock, Maybe the results of drm_dp_get_vc_payload_bw() can be but in a temporary variable. > if (slots == -EDEADLK) > return slots; > diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h > index bd1c39907b92..20dc705642bd 100644 > --- a/include/drm/drm_dp_mst_helper.h > +++ b/include/drm/drm_dp_mst_helper.h > @@ -783,7 +783,8 @@ drm_dp_mst_detect_port(struct drm_connector *connector, > > struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct > drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port); > > -int drm_dp_get_vc_payload_bw(int link_rate, int link_lane_count); > +int drm_dp_get_vc_payload_bw(const struct drm_dp_mst_topology_mgr *mgr, > +int link_rate, int link_lane_count); > > int drm_dp_calc_pbn_mode(int clock, int bpp, bool dsc); > > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 28/30] drm/dp: Convert drm_dp_helper.c to using drm_err/drm_dbg_*()
Hey Lyude, Thanks for the patch. On Fri, 19 Feb 2021 at 23:03, Lyude Paul wrote: > > Now that we've added a back-pointer to drm_device to drm_dp_aux, made > drm_dp_aux available to any functions in drm_dp_helper.c which need to > print to the kernel log, and ensured all of our logging uses a consistent > format, let's do the final step of the conversion and actually move > everything over to using drm_err() and drm_dbg_*(). > > This was done by using the following cocci script: > > @@ > expression list expr; > @@ > > ( > - DRM_DEBUG_KMS(expr); > + drm_dbg_kms(aux->drm_dev, expr); > | > - DRM_DEBUG_DP(expr); > + drm_dbg_dp(aux->drm_dev, expr); > | > - DRM_DEBUG_ATOMIC(expr); > + drm_dbg_atomic(aux->drm_dev, expr); > | > - DRM_DEBUG_KMS_RATELIMITED(expr); > + drm_dbg_kms_ratelimited(aux->drm_dev, expr); > | > - DRM_ERROR(expr); > + drm_err(aux->drm_dev, expr); > ) > > Followed by correcting the resulting line-wrapping in the results by hand. > > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/drm_dp_helper.c | 122 > 1 file changed, 60 insertions(+), 62 deletions(-) > > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c > index b5e2671baf22..0a787ddf39fd 100644 > --- a/drivers/gpu/drm/drm_dp_helper.c > +++ b/drivers/gpu/drm/drm_dp_helper.c > @@ -139,8 +139,8 @@ void drm_dp_link_train_clock_recovery_delay(const struct > drm_dp_aux *aux, > DP_TRAINING_AUX_RD_MASK; > > if (rd_interval > 4) > - DRM_DEBUG_KMS("%s: AUX interval %lu, out of range (max 4)\n", > - aux->name, rd_interval); > + drm_dbg_kms(aux->drm_dev, "%s: AUX interval %lu, out of range > (max 4)\n", > + aux->name, rd_interval); > > if (rd_interval == 0 || dpcd[DP_DPCD_REV] >= DP_DPCD_REV_14) > rd_interval = 100; > @@ -155,8 +155,8 @@ static void __drm_dp_link_train_channel_eq_delay(const > struct drm_dp_aux *aux, > unsigned long rd_interval) > { > if (rd_interval > 4) > - DRM_DEBUG_KMS("%s: AUX interval %lu, out of range (max 4)\n", > - aux->name, rd_interval); > + drm_dbg_kms(aux->drm_dev, "%s: AUX interval %lu, out of range > (max 4)\n", > + aux->name, rd_interval); > > if (rd_interval == 0) > rd_interval = 400; > @@ -220,11 +220,12 @@ drm_dp_dump_access(const struct drm_dp_aux *aux, > const char *arrow = request == DP_AUX_NATIVE_READ ? "->" : "<-"; > > if (ret > 0) > - DRM_DEBUG_DP("%s: 0x%05x AUX %s (ret=%3d) %*ph\n", > -aux->name, offset, arrow, ret, min(ret, 20), > buffer); > + drm_dbg_dp(aux->drm_dev, "%s: 0x%05x AUX %s (ret=%3d) %*ph\n", > + aux->name, offset, arrow, ret, min(ret, 20), > + buffer); checkpatch --strict is unhappy with this chunk ERROR: code indent should use tabs where possible #75: FILE: drivers/gpu/drm/drm_dp_helper.c:224: +^I^I aux->name, offset, arrow, ret, min(ret, 20),$ ERROR: code indent should use tabs where possible #76: FILE: drivers/gpu/drm/drm_dp_helper.c:225: > else > - DRM_DEBUG_DP("%s: 0x%05x AUX %s (ret=%3d)\n", > -aux->name, offset, arrow, ret); > + drm_dbg_dp(aux->drm_dev, "%s: 0x%05x AUX %s (ret=%3d)\n", > + aux->name, offset, arrow, ret); checkpatch --strict is unhappy with this chunk ERROR: code indent should use tabs where possible #81: FILE: drivers/gpu/drm/drm_dp_helper.c:228: +^I^I aux->name, offset, arrow, ret);$ > } > > /** > @@ -287,8 +288,8 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 > request, > err = ret; > } > > - DRM_DEBUG_KMS("%s: Too many retries, giving up. First error: %d\n", > - aux->name, err); > + drm_dbg_kms(aux->drm_dev, "%s: Too many retries, giving up. First > error: %d\n", > + aux->name, err); > ret = err; > > unlock: > @@ -524,44 +525,44 @@ bool drm_dp_send_real_edid_checksum(struct drm_dp_aux > *aux, > > if (drm_dp_dpcd_read(aux, DP_DEVICE_SERVICE_IRQ_VECTOR, > &auto_test_req, 1) < 1) { > - DRM_ERROR("%s: DPCD failed read at register 0x%x\n", > - aux->name, DP_DEVICE_SERVICE_IRQ_VECTOR); > + drm_err(aux->drm_dev, "%s: DPCD failed read at register > 0x%x\n", > + aux->name, DP_DEVICE_SERVICE_IRQ_VECTOR); > return false; > } > auto_test_req &= DP_AUTOMATED_TEST_REQUEST; > > if (drm_dp_dpcd_read(aux, DP_TEST_REQUEST, &link_edid_read, 1) < 1) { > - DRM_ER
Re: [PATCH 30/30] drm/dp_mst: Convert drm_dp_mst_topology.c to drm_err()/drm_dbg*()
Hey Lyude, Thanks for the patch On Fri, 19 Feb 2021 at 23:03, Lyude Paul wrote: > > And finally, convert all of the code in drm_dp_mst_topology.c over to using > drm_err() and drm_dbg*(). Note that this refactor would have been a lot > more complicated to have tried writing a coccinelle script for, so this > whole thing was done by hand. > > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/drm_dp_mst_topology.c | 369 +- > 1 file changed, 187 insertions(+), 182 deletions(-) > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c > b/drivers/gpu/drm/drm_dp_mst_topology.c > index fb66df39e0bb..f66232954689 100644 > --- a/drivers/gpu/drm/drm_dp_mst_topology.c > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c > @@ -286,7 +286,8 @@ static void drm_dp_encode_sideband_msg_hdr(struct > drm_dp_sideband_msg_hdr *hdr, > *len = idx; > } > > -static bool drm_dp_decode_sideband_msg_hdr(struct drm_dp_sideband_msg_hdr > *hdr, > +static bool drm_dp_decode_sideband_msg_hdr(const struct > drm_dp_mst_topology_mgr *mgr, > + struct drm_dp_sideband_msg_hdr > *hdr, >u8 *buf, int buflen, u8 *hdrlen) > { > u8 crc4; > @@ -303,7 +304,7 @@ static bool drm_dp_decode_sideband_msg_hdr(struct > drm_dp_sideband_msg_hdr *hdr, > crc4 = drm_dp_msg_header_crc4(buf, (len * 2) - 1); > > if ((crc4 & 0xf) != (buf[len - 1] & 0xf)) { > - DRM_DEBUG_KMS("crc4 mismatch 0x%x 0x%x\n", crc4, buf[len - > 1]); > + drm_dbg_kms(mgr->dev, "crc4 mismatch 0x%x 0x%x\n", crc4, > buf[len - 1]); > return false; > } > > @@ -789,7 +790,8 @@ static bool drm_dp_sideband_append_payload(struct > drm_dp_sideband_msg_rx *msg, > return true; > } > > -static bool drm_dp_sideband_parse_link_address(struct drm_dp_sideband_msg_rx > *raw, > +static bool drm_dp_sideband_parse_link_address(const struct > drm_dp_mst_topology_mgr *mgr, > + struct drm_dp_sideband_msg_rx > *raw, >struct > drm_dp_sideband_msg_reply_body *repmsg) > { > int idx = 1; > @@ -1014,7 +1016,8 @@ drm_dp_sideband_parse_query_stream_enc_status( > return true; > } > > -static bool drm_dp_sideband_parse_reply(struct drm_dp_sideband_msg_rx *raw, > +static bool drm_dp_sideband_parse_reply(const struct drm_dp_mst_topology_mgr > *mgr, > + struct drm_dp_sideband_msg_rx *raw, > struct drm_dp_sideband_msg_reply_body > *msg) > { > memset(msg, 0, sizeof(*msg)); > @@ -1030,7 +1033,7 @@ static bool drm_dp_sideband_parse_reply(struct > drm_dp_sideband_msg_rx *raw, > > switch (msg->req_type) { > case DP_LINK_ADDRESS: > - return drm_dp_sideband_parse_link_address(raw, msg); > + return drm_dp_sideband_parse_link_address(mgr, raw, msg); > case DP_QUERY_PAYLOAD: > return drm_dp_sideband_parse_query_payload_ack(raw, msg); > case DP_REMOTE_DPCD_READ: > @@ -1053,14 +1056,16 @@ static bool drm_dp_sideband_parse_reply(struct > drm_dp_sideband_msg_rx *raw, > case DP_QUERY_STREAM_ENC_STATUS: > return drm_dp_sideband_parse_query_stream_enc_status(raw, > msg); > default: > - DRM_ERROR("Got unknown reply 0x%02x (%s)\n", msg->req_type, > - drm_dp_mst_req_type_str(msg->req_type)); > + drm_err(mgr->dev, "Got unknown reply 0x%02x (%s)\n", > + msg->req_type, > drm_dp_mst_req_type_str(msg->req_type)); > return false; > } > } > > -static bool drm_dp_sideband_parse_connection_status_notify(struct > drm_dp_sideband_msg_rx *raw, > - struct > drm_dp_sideband_msg_req_body *msg) > +static bool > +drm_dp_sideband_parse_connection_status_notify(const struct > drm_dp_mst_topology_mgr *mgr, > + struct drm_dp_sideband_msg_rx > *raw, > + struct > drm_dp_sideband_msg_req_body *msg) > { > int idx = 1; > > @@ -1082,12 +1087,14 @@ static bool > drm_dp_sideband_parse_connection_status_notify(struct drm_dp_sideban > idx++; > return true; > fail_len: > - DRM_DEBUG_KMS("connection status reply parse length fail %d %d\n", > idx, raw->curlen); > + drm_dbg_kms(mgr->dev, "connection status reply parse length fail %d > %d\n", > + idx, raw->curlen); > return false; > } > > -static bool drm_dp_sideband_parse_resource_status_notify(struct > drm_dp_sideband_msg_rx *raw, > - struct > drm_dp_sideband_msg_req_body *msg) > +static bool drm_dp_sideband_parse_resource_status_notify(const struc
Re: [PATCH] drm/tegra: dc: Restore coupling of display controllers
19.03.2021 10:06, Thierry Reding пишет: > From: Thierry Reding > > Coupling of display controllers used to rely on runtime PM to take the > companion controller out of reset. Commit fd67e9c6ed5a ("drm/tegra: Do > not implement runtime PM") accidentally broke this when runtime PM was > removed. > > Restore this functionality by reusing the hierarchical host1x client > suspend/resume infrastructure that's similar to runtime PM and which > perfectly fits this use-case. > > Fixes: fd67e9c6ed5a ("drm/tegra: Do not implement runtime PM") > Reported-by: Dmitry Osipenko > Signed-off-by: Thierry Reding Hi, This bug was originally reported by Paul Fertser, I redirected it to you. Reported-by: Paul Fertser Formally, the stable kernel needs to be CCed since we want to have this patch applied to the stable kernels. Cc: sta...@vger.kernel.org Otherwise this is good to me, thank you! Tested-by: Dmitry Osipenko ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/3] drm/ttm: move swapout logic around v2
General question for the audience: Is there any way to silence the build bot here? This is a well known false positive. Regards, Christian. Am 18.03.21 um 19:13 schrieb kernel test robot: Hi "Christian, I love your patch! Yet something to improve: [auto build test ERROR on drm-tip/drm-tip] [also build test ERROR on next-20210318] [cannot apply to drm-intel/for-linux-next drm-exynos/exynos-drm-next linus/master v5.12-rc3] [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/Christian-K-nig/drm-ttm-move-swapout-logic-around-v2/20210318-204848 base: git://anongit.freedesktop.org/drm/drm-tip drm-tip config: x86_64-randconfig-a005-20210318 (attached as .config) compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 6db3ab2903f42712f44000afb5aa467efbd25f35) 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/a454d56ea061b53d24a62a700743e4508dd6c9b1 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Christian-K-nig/drm-ttm-move-swapout-logic-around-v2/20210318-204848 git checkout a454d56ea061b53d24a62a700743e4508dd6c9b1 # 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 errors (new ones prefixed by >>): drivers/gpu/drm/ttm/ttm_device.c:109:5: error: conflicting types for 'ttm_global_swapout' int ttm_global_swapout(struct ttm_operation_ctx *ctx, gfp_t gfp_flags) ^ include/drm/ttm/ttm_device.h:300:6: note: previous declaration is here long ttm_global_swapout(struct ttm_operation_ctx *ctx, gfp_t gfp_flags); ^ 1 error generated. vim +/ttm_global_swapout +109 drivers/gpu/drm/ttm/ttm_device.c 104 105 /** 106 * A buffer object shrink method that tries to swap out the first 107 * buffer object on the global::swap_lru list. 108 */ > 109 int ttm_global_swapout(struct ttm_operation_ctx *ctx, gfp_t gfp_flags) 110 { 111 struct ttm_global *glob = &ttm_glob; 112 struct ttm_buffer_object *bo; 113 unsigned i; 114 int ret; 115 116 spin_lock(&glob->lru_lock); 117 for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) { 118 list_for_each_entry(bo, &glob->swap_lru[i], swap) { 119 uint32_t num_pages = bo->ttm->num_pages; 120 121 ret = ttm_bo_swapout(bo, ctx, gfp_flags); 122 /* ttm_bo_swapout has dropped the lru_lock */ 123 if (!ret) 124 return num_pages; 125 if (ret != -EBUSY) 126 return ret; 127 } 128 } 129 spin_unlock(&glob->lru_lock); 130 return 0; 131 } 132 EXPORT_SYMBOL(ttm_global_swapout); 133 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] gpu/drm/msm: fix shutdown hook in case GPU components failed to bind
Hi Dmitry, On Mon, Mar 1, 2021 at 6:41 PM Dmitry Baryshkov wrote: > diff --git a/drivers/gpu/drm/msm/msm_atomic.c > b/drivers/gpu/drm/msm/msm_atomic.c > index 6a326761dc4a..2fd0cf6421ad 100644 > --- a/drivers/gpu/drm/msm/msm_atomic.c > +++ b/drivers/gpu/drm/msm/msm_atomic.c > @@ -207,7 +207,12 @@ void msm_atomic_commit_tail(struct drm_atomic_state > *state) > struct msm_kms *kms = priv->kms; > struct drm_crtc *async_crtc = NULL; > unsigned crtc_mask = get_crtc_mask(state); > - bool async = kms->funcs->vsync_time && > + bool async; > + > + if (!kms) > + return; > + > + async = kms->funcs->vsync_time && > can_do_async(state, &async_crtc); I also see the same issue on a i.MX53: https://lists.freedesktop.org/archives/freedreno/2021-January/009369.html Then I got a different suggestion from Rob. Please check: https://www.spinics.net/lists/dri-devel/msg286648.html and https://www.spinics.net/lists/dri-devel/msg286649.html Does this series fix the issue in your platform too? ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/3] drm/ttm: switch to per device LRU lock
Am 19.03.21 um 05:32 schrieb Huang Rui: On Thu, Mar 18, 2021 at 08:47:19PM +0800, Christian König wrote: Instead of having a global lock. Signed-off-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 ++--- drivers/gpu/drm/qxl/qxl_release.c | 5 +-- drivers/gpu/drm/ttm/ttm_bo.c | 49 -- drivers/gpu/drm/ttm/ttm_device.c | 12 +++ drivers/gpu/drm/ttm/ttm_execbuf_util.c | 8 ++--- drivers/gpu/drm/ttm/ttm_resource.c | 9 +++-- include/drm/ttm/ttm_bo_driver.h| 4 +-- include/drm/ttm/ttm_device.h | 4 +-- 8 files changed, 43 insertions(+), 56 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 9d19078246c8..ae18c0e32347 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -638,15 +638,15 @@ void amdgpu_vm_move_to_lru_tail(struct amdgpu_device *adev, struct amdgpu_vm_bo_base *bo_base; if (vm->bulk_moveable) { - spin_lock(&ttm_glob.lru_lock); + spin_lock(&adev->mman.bdev.lru_lock); Could you please explain why do you want to instead of the global lock? Potentially less contention. But you are right mentioning this in the commit message is a good idea. Regards, Christian. Thanks, Ray ttm_bo_bulk_move_lru_tail(&vm->lru_bulk_move); - spin_unlock(&ttm_glob.lru_lock); + spin_unlock(&adev->mman.bdev.lru_lock); return; } memset(&vm->lru_bulk_move, 0, sizeof(vm->lru_bulk_move)); - spin_lock(&ttm_glob.lru_lock); + spin_lock(&adev->mman.bdev.lru_lock); list_for_each_entry(bo_base, &vm->idle, vm_status) { struct amdgpu_bo *bo = bo_base->bo; @@ -660,7 +660,7 @@ void amdgpu_vm_move_to_lru_tail(struct amdgpu_device *adev, &bo->shadow->tbo.mem, &vm->lru_bulk_move); } - spin_unlock(&ttm_glob.lru_lock); + spin_unlock(&adev->mman.bdev.lru_lock); vm->bulk_moveable = true; } diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c index f5845c96d414..b19f2f00b215 100644 --- a/drivers/gpu/drm/qxl/qxl_release.c +++ b/drivers/gpu/drm/qxl/qxl_release.c @@ -426,16 +426,13 @@ void qxl_release_fence_buffer_objects(struct qxl_release *release) release->id | 0xf000, release->base.seqno); trace_dma_fence_emit(&release->base); - spin_lock(&ttm_glob.lru_lock); - list_for_each_entry(entry, &release->bos, head) { bo = entry->bo; dma_resv_add_shared_fence(bo->base.resv, &release->base); - ttm_bo_move_to_lru_tail(bo, &bo->mem, NULL); + ttm_bo_move_to_lru_tail_unlocked(bo); dma_resv_unlock(bo->base.resv); } - spin_unlock(&ttm_glob.lru_lock); ww_acquire_fini(&release->ticket); } diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 3673157527ff..2d2ac532987e 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -243,9 +243,9 @@ static int ttm_bo_individualize_resv(struct ttm_buffer_object *bo) * reference it any more. The only tricky case is the trylock on * the resv object while holding the lru_lock. */ - spin_lock(&ttm_glob.lru_lock); + spin_lock(&bo->bdev->lru_lock); bo->base.resv = &bo->base._resv; - spin_unlock(&ttm_glob.lru_lock); + spin_unlock(&bo->bdev->lru_lock); } return r; @@ -304,7 +304,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo, if (unlock_resv) dma_resv_unlock(bo->base.resv); - spin_unlock(&ttm_glob.lru_lock); + spin_unlock(&bo->bdev->lru_lock); lret = dma_resv_wait_timeout_rcu(resv, true, interruptible, 30 * HZ); @@ -314,7 +314,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo, else if (lret == 0) return -EBUSY; - spin_lock(&ttm_glob.lru_lock); + spin_lock(&bo->bdev->lru_lock); if (unlock_resv && !dma_resv_trylock(bo->base.resv)) { /* * We raced, and lost, someone else holds the reservation now, @@ -324,7 +324,7 @@ static int ttm_bo_cleanup_refs(struct ttm_buffer_object *bo, * delayed destruction would succeed, so just return success * here. */ - spin_unlock(&ttm_glob.lru_lock); + spin_unlock(&bo->bdev->lru_lock); return 0; } ret = 0; @@
[PATCH 3/3] drm/vc4: Add HDR metadata property to the VC5 HDMI connectors
From: Dave Stevenson Now that we can export deeper colour depths, add in the signalling for HDR metadata. Signed-off-by: Dave Stevenson Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 53 ++ drivers/gpu/drm/vc4/vc4_hdmi.h | 3 ++ 2 files changed, 56 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index eee9751009c2..c8846cf9dd24 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -214,6 +214,31 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) return ret; } +static int vc4_hdmi_connector_atomic_check(struct drm_connector *connector, + struct drm_atomic_state *state) +{ + struct drm_connector_state *old_state = + drm_atomic_get_old_connector_state(state, connector); + struct drm_connector_state *new_state = + drm_atomic_get_new_connector_state(state, connector); + struct drm_crtc *crtc = new_state->crtc; + + if (!crtc) + return 0; + + if (!drm_connector_atomic_hdr_metadata_equal(old_state, new_state)) { + struct drm_crtc_state *crtc_state; + + crtc_state = drm_atomic_get_crtc_state(state, crtc); + if (IS_ERR(crtc_state)) + return PTR_ERR(crtc_state); + + crtc_state->mode_changed = true; + } + + return 0; +} + static void vc4_hdmi_connector_reset(struct drm_connector *connector) { struct vc4_hdmi_connector_state *old_state = @@ -263,6 +288,7 @@ static const struct drm_connector_funcs vc4_hdmi_connector_funcs = { static const struct drm_connector_helper_funcs vc4_hdmi_connector_helper_funcs = { .get_modes = vc4_hdmi_connector_get_modes, + .atomic_check = vc4_hdmi_connector_atomic_check, }; static int vc4_hdmi_connector_init(struct drm_device *dev, @@ -299,6 +325,9 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, connector->interlace_allowed = 1; connector->doublescan_allowed = 0; + if (vc4_hdmi->variant->supports_hdr) + drm_connector_attach_hdr_output_metadata_property(connector); + drm_connector_attach_encoder(connector, encoder); return 0; @@ -432,6 +461,25 @@ static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder) vc4_hdmi_write_infoframe(encoder, &frame); } +static void vc4_hdmi_set_hdr_infoframe(struct drm_encoder *encoder) +{ + struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); + struct drm_connector *connector = &vc4_hdmi->connector; + struct drm_connector_state *conn_state = connector->state; + union hdmi_infoframe frame; + + if (!vc4_hdmi->variant->supports_hdr) + return; + + if (!conn_state->hdr_output_metadata) + return; + + if (drm_hdmi_infoframe_set_hdr_metadata(&frame.drm, conn_state)) + return; + + vc4_hdmi_write_infoframe(encoder, &frame); +} + static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) { struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder); @@ -444,6 +492,8 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder) */ if (vc4_hdmi->audio.streaming) vc4_hdmi_set_audio_infoframe(encoder); + + vc4_hdmi_set_hdr_infoframe(encoder); } static void vc4_hdmi_encoder_post_crtc_disable(struct drm_encoder *encoder, @@ -2101,6 +2151,7 @@ static const struct vc4_hdmi_variant bcm2835_variant = { .phy_rng_enable = vc4_hdmi_phy_rng_enable, .phy_rng_disable= vc4_hdmi_phy_rng_disable, .channel_map= vc4_hdmi_channel_map, + .supports_hdr = false, }; static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { @@ -2128,6 +2179,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi0_variant = { .phy_rng_enable = vc5_hdmi_phy_rng_enable, .phy_rng_disable= vc5_hdmi_phy_rng_disable, .channel_map= vc5_hdmi_channel_map, + .supports_hdr = true, }; static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { @@ -2155,6 +2207,7 @@ static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { .phy_rng_enable = vc5_hdmi_phy_rng_enable, .phy_rng_disable= vc5_hdmi_phy_rng_disable, .channel_map= vc5_hdmi_channel_map, + .supports_hdr = true, }; static const struct of_device_id vc4_hdmi_dt_match[] = { diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h index 3cebd1fd00fc..060bcaefbeb5 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h @@ -99,6 +99,9 @@ struct vc4_hdmi_variant { /* Callback to get channel map */ u32 (*channel_map)(struct vc4_hdmi *vc4_hdmi, u32 chann
[PATCH 1/3] drm/connector: Create a helper to attach the hdr_output_metadata property
All the drivers that implement HDR output call pretty much the same function to initialise the hdr_output_metadata property, and while the creation of that property is in a helper, every driver uses the same code to attach it. Provide a helper for it as well Signed-off-by: Maxime Ripard --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 +-- drivers/gpu/drm/drm_connector.c | 21 +++ drivers/gpu/drm/i915/display/intel_hdmi.c | 3 +-- include/drm/drm_connector.h | 1 + 5 files changed, 25 insertions(+), 7 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 22124f76d0b5..06908a3cee0f 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -7017,9 +7017,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, if (connector_type == DRM_MODE_CONNECTOR_HDMIA || connector_type == DRM_MODE_CONNECTOR_DisplayPort || connector_type == DRM_MODE_CONNECTOR_eDP) { - drm_object_attach_property( - &aconnector->base.base, - dm->ddev->mode_config.hdr_output_metadata_property, 0); + drm_connector_attach_hdr_output_metadata_property(&aconnector->base); if (!aconnector->mst_port) drm_connector_attach_vrr_capable_property(&aconnector->base); diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index dda4fa9a1a08..f24bbb840dbf 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2492,8 +2492,7 @@ static int dw_hdmi_connector_create(struct dw_hdmi *hdmi) drm_connector_attach_max_bpc_property(connector, 8, 16); if (hdmi->version >= 0x200a && hdmi->plat_data->use_drm_infoframe) - drm_object_attach_property(&connector->base, - connector->dev->mode_config.hdr_output_metadata_property, 0); + drm_connector_attach_hdr_output_metadata_property(connector); drm_connector_attach_encoder(connector, hdmi->bridge.encoder); diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 98b6ec45ef96..e25248e23e18 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -2149,6 +2149,27 @@ int drm_connector_attach_max_bpc_property(struct drm_connector *connector, } EXPORT_SYMBOL(drm_connector_attach_max_bpc_property); +/** + * drm_connector_attach_hdr_output_metadata_property - attach "HDR_OUTPUT_METADA" property + * @connector: connector to attach the property on. + * + * This is used to allow the userspace to send HDR Metadata to the + * driver. + * + * Returns: + * Zero on success, negative errno on failure. + */ +int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *connector) +{ + struct drm_device *dev = connector->dev; + struct drm_property *prop = dev->mode_config.hdr_output_metadata_property; + + drm_object_attach_property(&connector->base, prop, 0); + + return 0; +} +EXPORT_SYMBOL(drm_connector_attach_hdr_output_metadata_property); + /** * drm_connector_set_vrr_capable_property - sets the variable refresh rate * capable property for a connector diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index c5959590562b..52c051efb7b7 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -2958,8 +2958,7 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c drm_connector_attach_content_type_property(connector); if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) - drm_object_attach_property(&connector->base, - connector->dev->mode_config.hdr_output_metadata_property, 0); + drm_connector_attach_hdr_output_metadata_property(connector); if (!HAS_GMCH(dev_priv)) drm_connector_attach_max_bpc_property(connector, 8, 12); diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 1922b278ffad..32172dab8427 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1671,6 +1671,7 @@ int drm_connector_attach_scaling_mode_property(struct drm_connector *connector, u32 scaling_mode_mask); int drm_connector_attach_vrr_capable_property( struct drm_connector *connector); +int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *connector); int drm_mode_create_aspect_ratio_property(struct drm_device *dev); int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector); int drm_mode
[PATCH 2/3] drm/connector: Add helper to compare HDR metadata
All the drivers that support the HDR metadata property have a similar function to compare the metadata from one connector state to the next, and force a mode change if they differ. All these functions run pretty much the same code, so let's turn it into an helper that can be shared across those drivers. Signed-off-by: Maxime Ripard --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 21 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 17 +-- drivers/gpu/drm/drm_connector.c | 28 +++ drivers/gpu/drm/i915/display/intel_atomic.c | 13 + include/drm/drm_connector.h | 2 ++ 5 files changed, 33 insertions(+), 48 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 06908a3cee0f..4eb5201e566a 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5924,25 +5924,6 @@ static int fill_hdr_info_packet(const struct drm_connector_state *state, return 0; } -static bool -is_hdr_metadata_different(const struct drm_connector_state *old_state, - const struct drm_connector_state *new_state) -{ - struct drm_property_blob *old_blob = old_state->hdr_output_metadata; - struct drm_property_blob *new_blob = new_state->hdr_output_metadata; - - if (old_blob != new_blob) { - if (old_blob && new_blob && - old_blob->length == new_blob->length) - return memcmp(old_blob->data, new_blob->data, - old_blob->length); - - return true; - } - - return false; -} - static int amdgpu_dm_connector_atomic_check(struct drm_connector *conn, struct drm_atomic_state *state) @@ -5960,7 +5941,7 @@ amdgpu_dm_connector_atomic_check(struct drm_connector *conn, if (!crtc) return 0; - if (is_hdr_metadata_different(old_con_state, new_con_state)) { + if (!drm_connector_atomic_hdr_metadata_equal(old_con_state, new_con_state)) { struct dc_info_packet hdr_infopacket; ret = fill_hdr_info_packet(new_con_state, &hdr_infopacket); diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index f24bbb840dbf..f871e33c2fc9 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2395,21 +2395,6 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector) return ret; } -static bool hdr_metadata_equal(const struct drm_connector_state *old_state, - const struct drm_connector_state *new_state) -{ - struct drm_property_blob *old_blob = old_state->hdr_output_metadata; - struct drm_property_blob *new_blob = new_state->hdr_output_metadata; - - if (!old_blob || !new_blob) - return old_blob == new_blob; - - if (old_blob->length != new_blob->length) - return false; - - return !memcmp(old_blob->data, new_blob->data, old_blob->length); -} - static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, struct drm_atomic_state *state) { @@ -2423,7 +2408,7 @@ static int dw_hdmi_connector_atomic_check(struct drm_connector *connector, if (!crtc) return 0; - if (!hdr_metadata_equal(old_state, new_state)) { + if (!drm_connector_atomic_hdr_metadata_equal(old_state, new_state)) { crtc_state = drm_atomic_get_crtc_state(state, crtc); if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state); diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index e25248e23e18..d781a3a1e9bf 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -2170,6 +2170,34 @@ int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *conn } EXPORT_SYMBOL(drm_connector_attach_hdr_output_metadata_property); +/** + * drm_connector_atomic_hdr_metadata_equal - checks if the hdr metadata changed + * @old_state: old connector state to compare + * @new_state: new connector state to compare + * + * This is used by HDR-enabled drivers to test whether the HDR metadata + * have changed between two different connector state (and thus probably + * requires a full blown mode change). + * + * Returns: + * True if the metadata are equal, False otherwise + */ +bool drm_connector_atomic_hdr_metadata_equal(struct drm_connector_state *old_state, +struct drm_connector_state *new_state) +{ + struct drm_property_blob *old_blob = old_state->hdr_output_metadata; + struct drm_property_blob *new_blob = new_state->hdr_output_metadata; + + if (!old_blob || !new_blo
[v1] drm/msm/disp/dpu1: fix display underruns during modeset.
During crtc disable, display perf structures are reset to 0 which includes state varibles which are immutable. On crtc enable, we use the same structures and they don't refelect the actual values 1) Fix is to avoid updating the state structures during disable. 2) Reset the perf structures during atomic check when there is no modeset enable. Signed-off-by: Kalyan Thota --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 1 - drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c index 37c8270..b4cd479 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -382,7 +382,6 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, } else { DPU_DEBUG("crtc=%d disable\n", crtc->base.id); memset(old, 0, sizeof(*old)); - memset(new, 0, sizeof(*new)); update_bus = true; update_clk = true; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 9a80981..a821e2c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -912,6 +912,7 @@ static int dpu_crtc_atomic_check(struct drm_crtc *crtc, if (!state->enable || !state->active) { DPU_DEBUG("crtc%d -> enable %d, active %d, skip atomic_check\n", crtc->base.id, state->enable, state->active); + memset(&cstate->new_perf, 0, sizeof(cstate->new_perf)); goto end; } -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/tilcdc: fix LCD pixel clock setting
On 2021-03-18 23:47, Dario Binacchi wrote: Il 17/03/2021 09:19 Tomi Valkeinen ha scritto: On 14/03/2021 17:13, Dario Binacchi wrote: > As reported by TI spruh73x RM, the LCD pixel clock (LCD_PCLK) frequency > is obtained by dividing LCD_CLK, the LCD controller reference clock, > for CLKDIV: > > LCD_PCLK = LCD_CLK / CLKDIV > > where CLKDIV must be greater than 1. > > Therefore LCD_CLK must be set to 'req_rate * CLKDIV' instead of req_rate The above doesn't make sense, the code already sets LCD_CLK to 'req_rate * clkdiv', not req_rate. > and the real LCD_CLK rate must be compared with 'req_rate * CLKDIV' and > not with req_rate. This is true, the code looks at the wrong value. > Passing req_rate instead of 'req_rate * CLKDIV' to the tilcdc_pclk_diff > routine caused it to fail even if LCD_CLK was properly set. > > Signed-off-by: Dario Binacchi > > --- > > drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 9 + > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > index 30213708fc99..02f56c9a5da5 100644 > --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c > @@ -203,7 +203,7 @@ static void tilcdc_crtc_set_clk(struct drm_crtc *crtc) >struct drm_device *dev = crtc->dev; >struct tilcdc_drm_private *priv = dev->dev_private; >struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); > - unsigned long clk_rate, real_rate, req_rate; > + unsigned long clk_rate, real_rate, req_rate, clk_div_rate; >unsigned int clkdiv; >int ret; > > @@ -211,10 +211,11 @@ static void tilcdc_crtc_set_clk(struct drm_crtc *crtc) > >/* mode.clock is in KHz, set_rate wants parameter in Hz */ >req_rate = crtc->mode.clock * 1000; > - > - ret = clk_set_rate(priv->clk, req_rate * clkdiv); > + /* LCD clock divisor input rate */ > + clk_div_rate = req_rate * clkdiv; "clk_div_rate" sounds a bit odd to me. Why not lcd_fck_rate, as that's the name used later? Or lcd_clk_rate. Or maybe lcd_clk_req_rate... I prefer lcd_clk_rate. How about adding an additional patch that changes the variable names to make the code more readable? req_rate -> lcd_pclk_rate clk_rate -> real_lcd_clk_rate And add a comment to the function which highlights the relationship LCD_CLK = LCD_PCLK * CLDIV ? What about renaming current req_rate to pclk_rate (for pixel clock rate), and calling pclk_rate * clkdiv = req_rate, as that is the rate we need to request from the input clock? Adding lcd to local variable names here is quite redundant after all. In any case req_rate is bit misleading name here and probably part of the reason why the bug exists in the first place. Best regards, Jyri > + ret = clk_set_rate(priv->clk, clk_div_rate); >clk_rate = clk_get_rate(priv->clk); > - if (ret < 0 || tilcdc_pclk_diff(req_rate, clk_rate) > 5) { > + if (ret < 0 || tilcdc_pclk_diff(clk_div_rate, clk_rate) > 5) { >/* > * If we fail to set the clock rate (some architectures don't > * use the common clock framework yet and may not implement > I think this fix is fine, but looking at the current code, it's calling tilcdc_pclk_diff(), but doesn't actually provide pixel clocks to the function, but fclk. Yes, I agree. Thanks and regards, Dario Tomi ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/tegra: sor: Grab runtime PM reference across reset
From: Thierry Reding The SOR resets are exclusively shared with the SOR power domain. This means that exclusive access can only be granted temporarily and in order for that to work, a rigorous sequence must be observed. To ensure that a single consumer gets exclusive access to a reset, each consumer must implement a rigorous protocol using the reset_control_acquire() and reset_control_release() functions. However, these functions alone don't provide any guarantees at the system level. Drivers need to ensure that the only a single consumer has access to the reset at the same time. In order for the SOR to be able to exclusively access its reset, it must therefore ensure that the SOR power domain is not powered off by holding on to a runtime PM reference to that power domain across the reset assert/deassert operation. This used to work fine by accident, but was revealed when recently more devices started to rely on the SOR power domain. Fixes: 11c632e1cfd3 ("drm/tegra: sor: Implement acquire/release for reset") Reported-by: Jonathan Hunter Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/sor.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index f02a035dda45..7b88261f57bb 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -3115,6 +3115,12 @@ static int tegra_sor_init(struct host1x_client *client) * kernel is possible. */ if (sor->rst) { + err = pm_runtime_resume_and_get(sor->dev); + if (err < 0) { + dev_err(sor->dev, "failed to get runtime PM: %d\n", err); + return err; + } + err = reset_control_acquire(sor->rst); if (err < 0) { dev_err(sor->dev, "failed to acquire SOR reset: %d\n", @@ -3148,6 +3154,7 @@ static int tegra_sor_init(struct host1x_client *client) } reset_control_release(sor->rst); + pm_runtime_put(sor->dev); } err = clk_prepare_enable(sor->clk_safe); -- 2.30.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 212361] New: WARNING: CPU: 0 PID: 411 at drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr.c:833 rn_clk_mgr_construct+0x2dd/0x440 [amdgpu]
https://bugzilla.kernel.org/show_bug.cgi?id=212361 Bug ID: 212361 Summary: WARNING: CPU: 0 PID: 411 at drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21 /rn_clk_mgr.c:833 rn_clk_mgr_construct+0x2dd/0x440 [amdgpu] Product: Drivers Version: 2.5 Kernel Version: 5.12.0-rc3-00070-g8b12a62a4e3e Hardware: x86-64 OS: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: Video(DRI - non Intel) Assignee: drivers_video-...@kernel-bugs.osdl.org Reporter: gdam...@gmail.com Regression: No I'm getting the following on a AMD Ryzen 5 PRO 4650G with Radeon Graphics [ 10.537847] amdgpu :30:00.0: amdgpu: RAS: optional ras ta ucode is not available [ 10.545573] amdgpu :30:00.0: amdgpu: RAP: optional rap ta ucode is not available [ 10.545575] amdgpu :30:00.0: amdgpu: SECUREDISPLAY: securedisplay ta ucode is not available [ 10.545794] amdgpu :30:00.0: amdgpu: SMU is initialized successfully! [ 10.547115] [drm] kiq ring mec 2 pipe 1 q 0 [ 10.547613] [ cut here ] [ 10.547613] WARNING: CPU: 0 PID: 411 at drivers/gpu/drm/amd/amdgpu/../display/dc/clk_mgr/dcn21/rn_clk_mgr.c:833 rn_clk_mgr_construct+0x2dd/0x440 [amdgpu] [ 10.547778] Modules linked in: iptable_mangle(+) iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_filter bpfilter ccm algif_aead des_generic libdes ecb algif_skcipher cmac md4 algif_hash af_alg amdgpu(+) iwlmvm btrfs mac80211 raid1 dm_raid raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx md_mod blake2b_generic xor libarc4 iwlwifi drm_ttm_helper ttm gpu_sched i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt intel_rapl_msr intel_rapl_common fb_sys_fops cec kvm_amd cfg80211 kvm snd_hda_codec_realtek dm_thin_pool snd_hda_codec_generic snd_hda_codec_hdmi dm_persistent_data ledtrig_audio snd_hda_intel dm_bio_prison snd_intel_dspcfg dm_bufio snd_hda_codec libcrc32c raid6_pq r8169 bridge snd_hwdep snd_hda_core wmi_bmof realtek mdio_devres snd_pcm hid_logitech_hidpp of_mdio fixed_phy libphy snd_timer drm irqbypass mousedev snd joydev rapl sp5100_tco rfkill k10temp pcspkr i2c_piix4 soundcore wmi pinctrl_amd tpm_tis stp gpio_amdpt tpm_tis_core [ 10.547820] acpi_cpufreq llc mac_hid fuse pkcs8_key_parser crypto_user agpgart ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 dm_crypt cbc hid_logitech_dj encrypted_keys trusted hid_generic usbhid uas usb_storage dm_mod crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel aesni_intel xhci_pci ccp xhci_pci_renesas crypto_simd cryptd xhci_hcd tpm_crb tpm rng_core hid_lenovo hid vfat fat [ 10.547840] CPU: 0 PID: 411 Comm: systemd-udevd Not tainted 5.12.0-rc3-00070-g8b12a62a4e3e #22 [ 10.547842] Hardware name: Micro-Star International Co., Ltd. MS-7C94/MAG B550M MORTAR WIFI (MS-7C94), BIOS 1.20 08/03/2020 [ 10.547843] RIP: 0010:rn_clk_mgr_construct+0x2dd/0x440 [amdgpu] [ 10.547992] Code: ff ff b8 03 00 00 00 41 8b 8c c5 80 00 00 00 41 89 c1 89 c7 85 c9 74 0c 41 8b 94 c5 84 00 00 00 85 d2 75 75 48 83 e8 01 73 dd <0f> 0b e9 31 fe ff ff 48 c7 c6 00 5f 56 c1 b9 14 00 00 00 48 89 c7 [ 10.547993] RSP: 0018:a0c281663650 EFLAGS: 00010297 [ 10.547995] RAX: RBX: 91210c244840 RCX: 0640 [ 10.547996] RDX: RSI: a0c281663678 RDI: [ 10.547997] RBP: 91210a12ca00 R08: R09: [ 10.547997] R10: 7fc9117f R11: 91210c250800 R12: 912109495540 [ 10.547998] R13: a0c281663678 R14: 91210415 R15: fff0 [ 10.547999] FS: 7ff7a5594a40() GS:9127ef20() knlGS: [ 10.548000] CS: 0010 DS: ES: CR0: 80050033 [ 10.548001] CR2: 00c000b87c80 CR3: 0001023ce000 CR4: 00350ef0 [ 10.548002] Call Trace: [ 10.548006] dc_clk_mgr_create+0x178/0x260 [amdgpu] [ 10.548154] dc_create+0x256/0x7c0 [amdgpu] [ 10.548342] ? amdgpu_cgs_create_device+0x23/0x50 [amdgpu] [ 10.548543] ? kmem_cache_alloc_trace+0x169/0x2d0 [ 10.548547] amdgpu_dm_init.isra.0+0x1bd/0x250 [amdgpu] [ 10.548766] ? wake_up_klogd.part.0+0x4f/0x70 [ 10.548769] ? vprintk_emit+0xf4/0x1a0 [ 10.548774] dm_hw_init+0xe/0x20 [amdgpu] [ 10.549001] amdgpu_device_init.cold+0x1758/0x1b21 [amdgpu] [ 10.549214] amdgpu_driver_load_kms+0x64/0x260 [amdgpu] [ 10.549330] amdgpu_pci_probe+0x11f/0x1b0 [amdgpu] [ 10.549442] local_pci_probe+0x42/0x80 [ 10.549445] ? pci_match_device+0xd7/0x100 [ 10.549447] pci_device_probe+0xfa/0x1b0 [ 10.549449] really_probe+0xf2/0x440 [ 10.549453] driver_probe_device+0xe1/0x150 [ 10.549455] device_driver_attach+0xa1/0xb0 [ 10.549456] __driver_attach+0x8a/0x150 [ 10.549458] ? device_driver_attach+0xb0
Re: [PATCH 04/19] include: drm: drm_atomic: Make use of 'new_plane_state'
On Fri, Mar 19, 2021 at 08:24:13AM +, Lee Jones wrote: > In the macro for_each_oldnew_plane_in_state() 'new_plane_state' is provided > as a container for state->planes[i].new_state, but is not utilised in > some use-cases, so we fake-use it instead. > > Fixes the following W=1 kernel build warning(s): > > drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function > ‘amdgpu_dm_commit_cursors’: > drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7649:44: > warning: variable ‘new_plane_state’ set but not used > [-Wunused-but-set-variable] > > Cc: Maarten Lankhorst > Cc: Maxime Ripard > Cc: Thomas Zimmermann > Cc: David Airlie > Cc: Daniel Vetter > Cc: Rob Clark > Cc: dri-devel@lists.freedesktop.org > Signed-off-by: Lee Jones > --- > include/drm/drm_atomic.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h > index ac5a28eff2c86..259e6970dc836 100644 > --- a/include/drm/drm_atomic.h > +++ b/include/drm/drm_atomic.h > @@ -871,7 +871,8 @@ void drm_state_dump(struct drm_device *dev, struct > drm_printer *p); >((plane) = (__state)->planes[__i].ptr, \ > (void)(plane) /* Only to avoid > unused-but-set-variable warning */, \ > (old_plane_state) = > (__state)->planes[__i].old_state,\ > - (new_plane_state) = > (__state)->planes[__i].new_state, 1)) > + (new_plane_state) = > (__state)->planes[__i].new_state, \ > + (void)(new_plane_state) /* Only to avoid > unused-but-set-variable warning */, 1)) In this case you can just switch the code to use for_each_old_plane_in_state() instead. > > /** > * for_each_oldnew_plane_in_state_reverse - iterate over all planes in an > atomic > -- > 2.27.0 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrjälä Intel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/ttm: stop warning on TT shrinker failure
Don't print a warning when we fail to allocate a page for swapping things out. Also rely on memalloc_nofs_save/memalloc_nofs_restore instead of GFP_NOFS. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_tt.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 2f0833c98d2c..86fa3e82dacc 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -369,7 +369,7 @@ static unsigned long ttm_tt_shrinker_scan(struct shrinker *shrink, }; int ret; - ret = ttm_bo_swapout(&ctx, GFP_NOFS); + ret = ttm_bo_swapout(&ctx, GFP_KERNEL | __GFP_NOWARN); return ret < 0 ? SHRINK_EMPTY : ret; } @@ -389,10 +389,13 @@ static unsigned long ttm_tt_shrinker_count(struct shrinker *shrink, static int ttm_tt_debugfs_shrink_show(struct seq_file *m, void *data) { struct shrink_control sc = { .gfp_mask = GFP_KERNEL }; + unsigned int flags; fs_reclaim_acquire(GFP_KERNEL); + flags = memalloc_nofs_save(); seq_printf(m, "%lu/%lu\n", ttm_tt_shrinker_count(&mm_shrinker, &sc), ttm_tt_shrinker_scan(&mm_shrinker, &sc)); + memalloc_nofs_restore(flags); fs_reclaim_release(GFP_KERNEL); return 0; -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/amd/display: Set AMDGPU_DM_DEFAULT_MIN_BACKLIGHT to 0
On Fri, Mar 19, 2021 at 3:23 AM Evan Benn wrote: > > AMDGPU_DM_DEFAULT_MIN_BACKLIGHT was set to the value of 12 > to ensure no display backlight will flicker at low user brightness > settings. However this value is quite bright, so for devices that do not > implement the ACPI ATIF > ATIF_FUNCTION_QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS > functionality the user cannot set the brightness to a low level even if > the display would support such a low PWM. > > This ATIF feature is not implemented on for example AMD grunt chromebooks. > > Signed-off-by: Evan Benn > > --- > I could not find a justification for the reason for the value. It has > caused some noticable regression for users: > https://bugzilla.kernel.org/show_bug.cgi?id=203439 > > Maybe this can be either user controlled or userspace configured, but > preventing users from turning their backlight dim seems wrong. My understanding is that some panels flicker if you set the min to a value too low. This was a safe minimum if the platform didn't specify it's own safe minimum. I think we'd just be trading one bug for another (flickering vs not dim enough). Maybe a whitelist or blacklist would be a better solution? Alex > > Also reviewed here: > https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2748377 > > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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 573cf17262da..0129bd69b94e 100644 > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c > @@ -3151,7 +3151,7 @@ static int amdgpu_dm_mode_config_init(struct > amdgpu_device *adev) > return 0; > } > > -#define AMDGPU_DM_DEFAULT_MIN_BACKLIGHT 12 > +#define AMDGPU_DM_DEFAULT_MIN_BACKLIGHT 0 > #define AMDGPU_DM_DEFAULT_MAX_BACKLIGHT 255 > #define AUX_BL_DEFAULT_TRANSITION_TIME_MS 50 > > -- > 2.31.0.291.g576ba9dcdaf-goog > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/30] drm/bridge/tc358767: Don't register DP AUX channel until bridge is attached
Hey Lyude, This patch looks good to me. Reviewed-by: Robert Foss On Fri, 19 Feb 2021 at 22:56, Lyude Paul wrote: > > Since this is a bridge, we don't start out with a respective DRM device. > Likewise this means we don't have a connector, which also means that we > should be following drm_dp_aux_register()'s documentation advice and not > call drm_dp_aux_register() until we have a matching connector. Instead, > call drm_dp_aux_init() in tc_probe() and wait until tc_bridge_attach() to > register our AUX channel. We also add tc_bridge_detach() to handle > unregistering the AUX adapter once the bridge has been disconnected. > > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/bridge/tc358767.c | 20 +++- > 1 file changed, 15 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/tc358767.c > b/drivers/gpu/drm/bridge/tc358767.c > index 34a3e4e9f717..da89922721ed 100644 > --- a/drivers/gpu/drm/bridge/tc358767.c > +++ b/drivers/gpu/drm/bridge/tc358767.c > @@ -1414,11 +1414,15 @@ static int tc_bridge_attach(struct drm_bridge *bridge, > if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) > return 0; > > + ret = drm_dp_aux_register(&tc->aux); > + if (ret < 0) > + return ret; > + > /* Create DP/eDP connector */ > drm_connector_helper_add(&tc->connector, &tc_connector_helper_funcs); > ret = drm_connector_init(drm, &tc->connector, &tc_connector_funcs, > tc->bridge.type); > if (ret) > - return ret; > + goto aux_unregister; > > /* Don't poll if don't have HPD connected */ > if (tc->hpd_pin >= 0) { > @@ -1438,10 +1442,19 @@ static int tc_bridge_attach(struct drm_bridge *bridge, > drm_connector_attach_encoder(&tc->connector, tc->bridge.encoder); > > return 0; > +aux_unregister: > + drm_dp_aux_unregister(&tc->aux); > + return ret; > +} > + > +static void tc_bridge_detach(struct drm_bridge *bridge) > +{ > + drm_dp_aux_unregister(&bridge_to_tc(bridge)->aux); > } > > static const struct drm_bridge_funcs tc_bridge_funcs = { > .attach = tc_bridge_attach, > + .detach = tc_bridge_detach, > .mode_valid = tc_mode_valid, > .mode_set = tc_bridge_mode_set, > .enable = tc_bridge_enable, > @@ -1680,9 +1693,7 @@ static int tc_probe(struct i2c_client *client, const > struct i2c_device_id *id) > tc->aux.name = "TC358767 AUX i2c adapter"; > tc->aux.dev = tc->dev; > tc->aux.transfer = tc_aux_transfer; > - ret = drm_dp_aux_register(&tc->aux); > - if (ret) > - return ret; > + drm_dp_aux_init(&tc->aux); > > tc->bridge.funcs = &tc_bridge_funcs; > if (tc->hpd_pin >= 0) > @@ -1702,7 +1713,6 @@ static int tc_remove(struct i2c_client *client) > struct tc_data *tc = i2c_get_clientdata(client); > > drm_bridge_remove(&tc->bridge); > - drm_dp_aux_unregister(&tc->aux); > > return 0; > } > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 07/30] drm/bridge/analogix/anx78xx: Add missing drm_dp_aux_unregister() call
Hey Lyude, Thanks for the patch, it looks good to me. Reviewed-by: Robert Foss On Fri, 19 Feb 2021 at 22:56, Lyude Paul wrote: > > Surprisingly, this bridge actually registers it's AUX adapter at the > correct time already. Nice job! However, it does forget to actually > unregister the AUX adapter, so let's add a bridge function to handle that. > > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c > b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c > index 81debd02c169..ec4607dc01eb 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c > @@ -942,6 +942,11 @@ static int anx78xx_bridge_attach(struct drm_bridge > *bridge, > return 0; > } > > +static void anx78xx_bridge_detach(struct drm_bridge *bridge) > +{ > + drm_dp_aux_unregister(&bridge_to_anx78xx(bridge)->aux); > +} > + > static enum drm_mode_status > anx78xx_bridge_mode_valid(struct drm_bridge *bridge, > const struct drm_display_info *info, > @@ -1013,6 +1018,7 @@ static void anx78xx_bridge_enable(struct drm_bridge > *bridge) > > static const struct drm_bridge_funcs anx78xx_bridge_funcs = { > .attach = anx78xx_bridge_attach, > + .detach = anx78xx_bridge_detach, > .mode_valid = anx78xx_bridge_mode_valid, > .disable = anx78xx_bridge_disable, > .mode_set = anx78xx_bridge_mode_set, > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 08/30] drm/bridge/analogix/anx78xx: Setup encoder before registering connector
Hey Lyude, Thanks for the patch, it looks good to me. Reviewed-by: Robert Foss On Fri, 19 Feb 2021 at 22:56, Lyude Paul wrote: > > Since encoder mappings for connectors are exposed to userspace, we should > be attaching the encoder before exposing the connector to userspace. Just a > drive-by fix for an issue I noticed while fixing up usages of > drm_dp_aux_init()/drm_dp_aux_register() across the tree. > > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c > b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c > index ec4607dc01eb..338dd8531d4b 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c > @@ -924,12 +924,6 @@ static int anx78xx_bridge_attach(struct drm_bridge > *bridge, > drm_connector_helper_add(&anx78xx->connector, > &anx78xx_connector_helper_funcs); > > - err = drm_connector_register(&anx78xx->connector); > - if (err) { > - DRM_ERROR("Failed to register connector: %d\n", err); > - return err; > - } > - > anx78xx->connector.polled = DRM_CONNECTOR_POLL_HPD; > > err = drm_connector_attach_encoder(&anx78xx->connector, > @@ -939,6 +933,12 @@ static int anx78xx_bridge_attach(struct drm_bridge > *bridge, > return err; > } > > + err = drm_connector_register(&anx78xx->connector); > + if (err) { > + DRM_ERROR("Failed to register connector: %d\n", err); > + return err; > + } > + > return 0; > } > > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 09/30] drm/bridge/analogix/anx78xx: Cleanup on error in anx78xx_bridge_attach()
Hey Lyude, Thanks for the patch, it looks good to me. Reviewed-by: Robert Foss On Fri, 19 Feb 2021 at 22:56, Lyude Paul wrote: > > Just another issue I noticed while correcting usages of > drm_dp_aux_init()/drm_dp_aux_register() around the tree. If any of the > steps in anx78xx_bridge_attach() fail, we end up leaking resources. So, > let's fix that (and fix leaking a DP AUX adapter in the process) by > unrolling on errors. > > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 11 --- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c > b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c > index 338dd8531d4b..f20558618220 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c > @@ -918,7 +918,7 @@ static int anx78xx_bridge_attach(struct drm_bridge > *bridge, > DRM_MODE_CONNECTOR_DisplayPort); > if (err) { > DRM_ERROR("Failed to initialize connector: %d\n", err); > - return err; > + goto aux_unregister; > } > > drm_connector_helper_add(&anx78xx->connector, > @@ -930,16 +930,21 @@ static int anx78xx_bridge_attach(struct drm_bridge > *bridge, >bridge->encoder); > if (err) { > DRM_ERROR("Failed to link up connector to encoder: %d\n", > err); > - return err; > + goto connector_cleanup; > } > > err = drm_connector_register(&anx78xx->connector); > if (err) { > DRM_ERROR("Failed to register connector: %d\n", err); > - return err; > + goto connector_cleanup; > } > > return 0; > +connector_cleanup: > + drm_connector_cleanup(&anx78xx->connector); > +aux_unregister: > + drm_dp_aux_unregister(&anx78xx->aux); > + return err; > } > > static void anx78xx_bridge_detach(struct drm_bridge *bridge) > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 10/30] drm/bridge/analogix/anx6345: Add missing drm_dp_aux_unregister() call
Hey Lyude, Thanks for the patch, it looks good to me. Reviewed-by: Robert Foss On Fri, 19 Feb 2021 at 22:58, Lyude Paul wrote: > > Another driver I found that seems to forget to unregister it's DP AUX > device. Let's fix this by adding anx6345_bridge_detach(). > > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > index d9164fab044d..8e016ba7c54a 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > @@ -574,6 +574,11 @@ static int anx6345_bridge_attach(struct drm_bridge > *bridge, > return 0; > } > > +static void anx6345_bridge_detach(struct drm_bridge *bridge) > +{ > + drm_dp_aux_unregister(&bridge_to_anx6345(bridge)->aux); > +} > + > static enum drm_mode_status > anx6345_bridge_mode_valid(struct drm_bridge *bridge, > const struct drm_display_info *info, > @@ -624,6 +629,7 @@ static void anx6345_bridge_enable(struct drm_bridge > *bridge) > > static const struct drm_bridge_funcs anx6345_bridge_funcs = { > .attach = anx6345_bridge_attach, > + .detach = anx6345_bridge_detach, > .mode_valid = anx6345_bridge_mode_valid, > .disable = anx6345_bridge_disable, > .enable = anx6345_bridge_enable, > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 11/30] drm/bridge/analogix/anx6345: Don't link encoder until after connector registration
Hey Lyude, Thanks for the patch, it looks good to me. Reviewed-by: Robert Foss On Fri, 19 Feb 2021 at 22:58, Lyude Paul wrote: > > Another case of linking an encoder to a connector after the connector's > been registered. The proper place to do this is before connector > registration, so let's fix that. > > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > index 8e016ba7c54a..6258f16da0e8 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > @@ -556,12 +556,6 @@ static int anx6345_bridge_attach(struct drm_bridge > *bridge, > drm_connector_helper_add(&anx6345->connector, > &anx6345_connector_helper_funcs); > > - err = drm_connector_register(&anx6345->connector); > - if (err) { > - DRM_ERROR("Failed to register connector: %d\n", err); > - return err; > - } > - > anx6345->connector.polled = DRM_CONNECTOR_POLL_HPD; > > err = drm_connector_attach_encoder(&anx6345->connector, > @@ -571,6 +565,12 @@ static int anx6345_bridge_attach(struct drm_bridge > *bridge, > return err; > } > > + err = drm_connector_register(&anx6345->connector); > + if (err) { > + DRM_ERROR("Failed to register connector: %d\n", err); > + return err; > + } > + > return 0; > } > > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 12/30] drm/bridge/analogix/anx6345: Cleanup on errors in anx6345_bridge_attach()
Hey Lyude, Thanks for the patch, it looks good to me. Reviewed-by: Robert Foss On Fri, 19 Feb 2021 at 22:58, Lyude Paul wrote: > > Another drive-by fix I found when fixing DP AUX adapter across the kernel > tree - make sure we don't leak resources (and by proxy-AUX adapters) on > failures in anx6345_bridge_attach() by unrolling on errors. > > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 11 --- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > index 6258f16da0e8..aa6cda458eb9 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c > @@ -550,7 +550,7 @@ static int anx6345_bridge_attach(struct drm_bridge > *bridge, > DRM_MODE_CONNECTOR_eDP); > if (err) { > DRM_ERROR("Failed to initialize connector: %d\n", err); > - return err; > + goto aux_unregister; > } > > drm_connector_helper_add(&anx6345->connector, > @@ -562,16 +562,21 @@ static int anx6345_bridge_attach(struct drm_bridge > *bridge, >bridge->encoder); > if (err) { > DRM_ERROR("Failed to link up connector to encoder: %d\n", > err); > - return err; > + goto connector_cleanup; > } > > err = drm_connector_register(&anx6345->connector); > if (err) { > DRM_ERROR("Failed to register connector: %d\n", err); > - return err; > + goto connector_cleanup; > } > > return 0; > +connector_cleanup: > + drm_connector_cleanup(&anx6345->connector); > +aux_unregister: > + drm_dp_aux_unregister(&anx6345->aux); > + return err; > } > > static void anx6345_bridge_detach(struct drm_bridge *bridge) > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] gpu/drm/msm: fix shutdown hook in case GPU components failed to bind
On Fri, Mar 19, 2021 at 5:09 AM Fabio Estevam wrote: > > Hi Dmitry, > > On Mon, Mar 1, 2021 at 6:41 PM Dmitry Baryshkov > wrote: > > > diff --git a/drivers/gpu/drm/msm/msm_atomic.c > > b/drivers/gpu/drm/msm/msm_atomic.c > > index 6a326761dc4a..2fd0cf6421ad 100644 > > --- a/drivers/gpu/drm/msm/msm_atomic.c > > +++ b/drivers/gpu/drm/msm/msm_atomic.c > > @@ -207,7 +207,12 @@ void msm_atomic_commit_tail(struct drm_atomic_state > > *state) > > struct msm_kms *kms = priv->kms; > > struct drm_crtc *async_crtc = NULL; > > unsigned crtc_mask = get_crtc_mask(state); > > - bool async = kms->funcs->vsync_time && > > + bool async; > > + > > + if (!kms) > > + return; > > + > > + async = kms->funcs->vsync_time && > > can_do_async(state, &async_crtc); > > I also see the same issue on a i.MX53: > https://lists.freedesktop.org/archives/freedreno/2021-January/009369.html > > Then I got a different suggestion from Rob. Please check: > > https://www.spinics.net/lists/dri-devel/msg286648.html > and > https://www.spinics.net/lists/dri-devel/msg286649.html > > Does this series fix the issue in your platform too? I think that might not help if something fails to probe due to (for example) a missing dependency, so !priv->kms is probably a better check to cover both cases. But the 2nd patch makes a good point, that the suspend/resume path probably needs the same treatment BR, -R ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 13/30] drm/bridge/analogix/dp_core: Unregister DP AUX channel on error in analogix_dp_probe()
Hey Lyude, Thanks for the patch, it looks good to me. Reviewed-by: Robert Foss On Fri, 19 Feb 2021 at 22:58, Lyude Paul wrote: > > Just another drive-by fix I noticed while going through the tree to cleanup > DP aux adapter registration - make sure we unregister the DP AUX dev if > analogix_dp_probe() fails. > > Signed-off-by: Lyude Paul > --- > drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > index aa1bb86293fd..f115233b1cb9 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c > @@ -1782,6 +1782,7 @@ int analogix_dp_bind(struct analogix_dp_device *dp, > struct drm_device *drm_dev) > > err_disable_pm_runtime: > pm_runtime_disable(dp->dev); > + drm_dp_aux_unregister(&dp->aux); > > return ret; > } > -- > 2.29.2 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
On Thu, Mar 18, 2021 at 04:01:26PM -0700, Navare, Manasi wrote: > So basically we see this warning only in case of bigjoiner when > drm_atomic_check gets called without setting the state->allow_modeset flag. Considering the code is 'WARN(!state->allow_modeset, ...' that fact should be rather obvious. > > So do you think that in i915, in intel_atomic_check_bigjoiner() we should only > steal the crtc when allow_modeset flag is set in state? No. If you fully read drm_atomic_check_only() you will observe that it will reject any commit w/ allow_modeset==false which needs a modeset. And it does that before the WARN. So you're barking up the wrong tree here. The problem I think is that you're just computing requested_crtcs wrong. > If we add this check there then the affected crtc wont count the slave crtc > and we wont get this warning. > > Ville, Danvet? > > Manasi > > > On Tue, Mar 16, 2021 at 10:35:09PM +0100, Daniel Vetter wrote: > > On Tue, Mar 9, 2021 at 10:14 AM Pekka Paalanen wrote: > > > > > > On Mon, 8 Mar 2021 16:52:58 -0800 > > > "Navare, Manasi" wrote: > > > > > > > On Thu, Mar 04, 2021 at 10:42:23AM +0200, Pekka Paalanen wrote: > > > > > On Wed, 3 Mar 2021 12:44:33 -0800 > > > > > "Navare, Manasi" wrote: > > > > > > > > > > > On Wed, Mar 03, 2021 at 10:47:44AM +0200, Pekka Paalanen wrote: > > > > > > > On Tue, 2 Mar 2021 12:41:32 -0800 > > > > > > > Manasi Navare wrote: > > > > > > > > > > > > > > > In case of a modeset where a mode gets split across mutiple > > > > > > > > CRTCs > > > > > > > > in the driver specific implementation (bigjoiner in i915) we > > > > > > > > wrongly count > > > > > > > > the affected CRTCs based on the drm_crtc_mask and indicate the > > > > > > > > stolen CRTC as > > > > > > > > an affected CRTC in atomic_check_only(). > > > > > > > > This triggers a warning since affected CRTCs doent match > > > > > > > > requested CRTC. > > > > > > > > > > > > > > > > To fix this in such bigjoiner configurations, we should only > > > > > > > > increment affected crtcs if that CRTC is enabled in UAPI not > > > > > > > > if it is just used internally in the driver to split the mode. > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > I think that makes sense to me. Stealing CRTCs that are not > > > > > > > currently > > > > > > > used by the userspace (display server) should be ok, as long as > > > > > > > that > > > > > > > is completely invisible to userspace: meaning that it does not > > > > > > > cause > > > > > > > userspace to unexpectedly e.g. receive or miss per-crtc atomic > > > > > > > completion events. > > > > > > > > > > > > Yes since we are only doing atomic_check_only() here, the stolen > > > > > > > > > > But the real not-test-only commit will follow if this test-only commit > > > > > succeeds, and keeping the guarantees for the real commit are > > > > > important. > > > > > > > > Hmm well after the actual real commit, since the second crtc is stolen > > > > even though it is not being used for the display output, it is > > > > used for joiner so the uapi.enable will be true after the real commit. > > > > > > > > so actually the assertion would fail in this case. > > > > > > > > @Ville @Danvet any suggestions here in that case? > > > > That is very bad. We can't frob uapi state like that. I think that > > calls for even more checks to make sure kms drivers who try to play > > clever games don't get it wrong, so we probably need to check uapi > > enable and active state in another mask before/after ->atomic_check > > too. Or something like that. > > > > > Hi, > > > > > > that is not what I was talking about, but sounds like you found a > > > different problem. It seems like the problem you are talking about > > > would be guaranteed to be hit if bigjoiner was used. Have you not > > > tested this? > > > > > > However, I was talking about the real commit itself, not what happens > > > on commits after it, see below. > > > > > > > > > crtc is completely invisible to the userspace and hence that is > > > > > > indicated by uapi.enable which is not true for this stolen > > > > > > crtc. However if allow modeset flag set, then it will do a full > > > > > > modeset and indicate the uapi.enable for this stolen crtc as well > > > > > > since that cannot be used for other modeset requested by userspace. > > > > > > > > > > > > > > > > > > > > Can that also be asserted somehow, or does this already do that? > > > > > > > > > > > > Not clear what you want the assertion for? Could you elaborate > > > > > > > > > > As assertion that when the real atomic commit happens and then > > > > > completion events are fired, they match exactly the affected crtcs > > > > > mask. > > > > > > This is my concern and a question, although like I say below, only > > > tangential to this patch. > > > > > > However, as this patch aims to allow bigjoiner usage, naturally the > > > question will arise whether the completion events then match what > > > userspace expects
Re: [PATCH 2/3] drm/connector: Add helper to compare HDR metadata
Hi Maxime, I love your patch! Yet something to improve: [auto build test ERROR on drm-intel/for-linux-next] [also build test ERROR on drm-tip/drm-tip linus/master v5.12-rc3 next-20210319] [cannot apply to anholt/for-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/Maxime-Ripard/drm-connector-Create-a-helper-to-attach-the-hdr_output_metadata-property/20210319-205157 base: git://anongit.freedesktop.org/drm-intel for-linux-next config: sparc64-randconfig-r035-20210318 (attached as .config) compiler: sparc64-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/e12a697958cd6235d678394450f4cb7dbf958ed5 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Maxime-Ripard/drm-connector-Create-a-helper-to-attach-the-hdr_output_metadata-property/20210319-205157 git checkout e12a697958cd6235d678394450f4cb7dbf958ed5 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'amdgpu_dm_commit_cursors': drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:7678:44: warning: variable 'new_plane_state' set but not used [-Wunused-but-set-variable] 7678 | struct drm_plane_state *old_plane_state, *new_plane_state; |^~~ drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c: In function 'amdgpu_dm_atomic_commit_tail': >> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:8327:4: error: >> implicit declaration of function 'is_hdr_metadata_different' >> [-Werror=implicit-function-declaration] 8327 |is_hdr_metadata_different(old_con_state, new_con_state); |^ cc1: some warnings being treated as errors Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for FRAME_POINTER Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS || MCOUNT Selected by - LATENCYTOP && DEBUG_KERNEL && STACKTRACE_SUPPORT && PROC_FS && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86 - LOCKDEP && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT && !MIPS && !PPC && !ARM && !S390 && !MICROBLAZE && !ARC && !X86 vim +/is_hdr_metadata_different +8327 drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c e7b07ceef2a650 Harry Wentland 2017-08-10 8293 02d6a6fcdf68c4 David Francis 2018-12-18 8294 /* Handle connector state changes */ c2cea7063b85fc Leo (Sunpeng Li2017-10-12 8295) for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) { 54d76575246798 Leo (Sunpeng Li2017-10-12 8296)struct dm_connector_state *dm_new_con_state = to_dm_connector_state(new_con_state); 54d76575246798 Leo (Sunpeng Li2017-10-12 8297)struct dm_connector_state *dm_old_con_state = to_dm_connector_state(old_con_state); 54d76575246798 Leo (Sunpeng Li2017-10-12 8298)struct amdgpu_crtc *acrtc = to_amdgpu_crtc(dm_new_con_state->base.crtc); efc8278eecfd5e Anson Jacob 2021-02-18 8299 struct dc_surface_update dummy_updates[MAX_SURFACES]; 19afd79951e630 Nathan Chancellor 2019-02-01 8300 struct dc_stream_update stream_update; b232d4ed92eafb Nicholas Kazlauskas 2019-05-28 8301 struct dc_info_packet hdr_packet; e7b07ceef2a650 Harry Wentland 2017-08-10 8302 struct dc_stream_status *status = NULL; b232d4ed92eafb Nicholas Kazlauskas 2019-05-28 8303 bool abm_changed, hdr_changed, scaling_changed; e7b07ceef2a650 Harry Wentland 2017-08-10 8304 efc8278eecfd5e Anson Jacob 2021-02-18 8305 memset(&dummy_updates, 0, sizeof(dummy_updates)); 19afd79951e630 Nathan Chancellor 2019-02-01 8306 memset(&stream_update, 0, sizeof(stream_update)); 19afd79951e630 Nathan Chancellor 2019-02-01 8307 44d09c6a577c8e Harry Wentland 2018-03-15 8308 if (acrtc) { 0bc9706db3a35b Leo (Sunpeng Li2017-10-12 8309) new_crtc_state =
Re: [PATCH] drm/gma500: use NULL instead of using plain integer as pointer
On Wed, Mar 17, 2021 at 9:27 AM Yang Li wrote: > > This fixes the following sparse warnings: > drivers/gpu/drm/gma500/psb_drv.c:303:56: warning: Using plain integer as > NULL pointer > > Reported-by: Abaci Robot > Signed-off-by: Yang Li Applied to drm-misc-next Thanks Patrik > --- > drivers/gpu/drm/gma500/psb_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/gma500/psb_drv.c > b/drivers/gpu/drm/gma500/psb_drv.c > index 0bcab06..c2aab62 100644 > --- a/drivers/gpu/drm/gma500/psb_drv.c > +++ b/drivers/gpu/drm/gma500/psb_drv.c > @@ -303,7 +303,7 @@ static int psb_driver_load(struct drm_device *dev, > unsigned long flags) > > ret = -ENOMEM; > > - dev_priv->mmu = psb_mmu_driver_init(dev, 1, 0, 0); > + dev_priv->mmu = psb_mmu_driver_init(dev, 1, 0, NULL); > if (!dev_priv->mmu) > goto out_err; > > -- > 1.8.3.1 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/amd/display: Set AMDGPU_DM_DEFAULT_MIN_BACKLIGHT to 0
On 2021-03-19 10:22 a.m., Alex Deucher wrote: On Fri, Mar 19, 2021 at 3:23 AM Evan Benn wrote: AMDGPU_DM_DEFAULT_MIN_BACKLIGHT was set to the value of 12 to ensure no display backlight will flicker at low user brightness settings. However this value is quite bright, so for devices that do not implement the ACPI ATIF ATIF_FUNCTION_QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS functionality the user cannot set the brightness to a low level even if the display would support such a low PWM. This ATIF feature is not implemented on for example AMD grunt chromebooks. Signed-off-by: Evan Benn --- I could not find a justification for the reason for the value. It has caused some noticable regression for users: https://bugzilla.kernel.org/show_bug.cgi?id=203439>>> Maybe this can be either user controlled or userspace configured, but preventing users from turning their backlight dim seems wrong. My understanding is that some panels flicker if you set the min to a value too low. This was a safe minimum if the platform didn't specify it's own safe minimum. I think we'd just be trading one bug for another (flickering vs not dim enough). Maybe a whitelist or blacklist would be a better solution? Yeah, this is a NACK from me as-is for the reasons Alex described. I agree a whitelist approach might be best. Is this fix perhaps for OLED panels? If so we could use a different min-value for OLED panels that don't do PWM, but use 12 for everything else. Harry Alex Also reviewed here: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2748377>>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 573cf17262da..0129bd69b94e 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -3151,7 +3151,7 @@ static int amdgpu_dm_mode_config_init(struct amdgpu_device *adev) return 0; } -#define AMDGPU_DM_DEFAULT_MIN_BACKLIGHT 12 +#define AMDGPU_DM_DEFAULT_MIN_BACKLIGHT 0 #define AMDGPU_DM_DEFAULT_MAX_BACKLIGHT 255 #define AUX_BL_DEFAULT_TRANSITION_TIME_MS 50 -- 2.31.0.291.g576ba9dcdaf-goog ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel>> ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel>> ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] gpu/drm/msm: fix shutdown hook in case GPU components failed to bind
Hi Rob, On Fri, Mar 19, 2021 at 11:44 AM Rob Clark wrote: > I think that might not help if something fails to probe due to (for > example) a missing dependency, so !priv->kms is probably a better > check to cover both cases. But the 2nd patch makes a good point, that > the suspend/resume path probably needs the same treatment Thanks for the feedback. I will follow the same approach for fixing the suspend/resume path then. Let me test it and then I will re-submit Dmitry's patch and the one for suspend/resume as part of a patch series. Thanks ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] gpu/drm/msm: fix shutdown hook in case GPU components failed to bind
On Fri, Mar 19, 2021 at 8:13 AM Fabio Estevam wrote: > > Hi Rob, > > On Fri, Mar 19, 2021 at 11:44 AM Rob Clark wrote: > > > I think that might not help if something fails to probe due to (for > > example) a missing dependency, so !priv->kms is probably a better > > check to cover both cases. But the 2nd patch makes a good point, that > > the suspend/resume path probably needs the same treatment > > Thanks for the feedback. > I will follow the same approach for fixing the suspend/resume path then. > > Let me test it and then I will re-submit Dmitry's patch and the one > for suspend/resume as part of a patch series. Thanks, BR, -R ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/rockchip: Remove unused variable
Commit 977697e20b3d ("drm/atomic: Pass the full state to planes atomic disable and update") added the old_state variable instead of what used to be a parameter, but it also removed the sole user of that variable in the vop_plane_atomic_update function leading to an usused variable. Remove it. Fixes: 977697e20b3d ("drm/atomic: Pass the full state to planes atomic disable and update") Reported-by: Stephen Rothwell Signed-off-by: Maxime Ripard --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 81c70d7a0471..64469439ddf2 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -879,8 +879,6 @@ static void vop_plane_atomic_disable(struct drm_plane *plane, static void vop_plane_atomic_update(struct drm_plane *plane, struct drm_atomic_state *state) { - struct drm_plane_state *old_state = drm_atomic_get_old_plane_state(state, - plane); struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane); struct drm_crtc *crtc = new_state->crtc; -- 2.30.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/i915/display/vlv_dsi: Do no shut down displays on reboot if a DSI panel is used
Hi, On 3/1/21 4:43 PM, Hans de Goede wrote: > After the recently added commit fe0f1e3bfdfe ("drm/i915: Shut down > displays gracefully on reboot"), the DSI panel on a Cherry Trail based > Predia Basic tablet would no longer properly light up after reboot. > > The backlight still turns back on after reboot, but the LCD shows an > all black display. The display is also all black during the time that > EFI / the GOP is managing it, so e.g. the grub menu also is not visible. > > In this scenario the panel is initialized so that it appears to be working > and the fastboot code skips doing a modeset. Forcing a modeset by doing a > chvt to a text-console over ssh followed by echo-ing 1 and then 0 to > /sys/class/graphics/fb0/blank causes the panel to work again. > > Add a QUIRK_SKIP_SHUTDOWN quirk which turns i915_driver_shutdown() into > a no-op when set; and set this on vlv/chv devices when a DSI panel is > detected, to work around this. > > Admittedly this is a bit of a big hammer, but these platforms have been > around for quite some time now and they have always worked fine without > the new behavior to shutdown everything on shutdown/reboot. This approach > simply disables the recently introduced new shutdown behavior in this > specific case where it is known to cause problems. Which is a nice and > simple way to deal with this. > > Signed-off-by: Hans de Goede Ping? Since sending this patch I've been seeing the issue addressed by this on variour other CHT based devices too. So we have various devices suffering from a black screen after reboot now. This is pretty serious usability regression. As such it would be good to get this reviewed, or another fix proposed. Regards, Hans > --- > drivers/gpu/drm/i915/display/vlv_dsi.c | 3 +++ > drivers/gpu/drm/i915/i915_drv.c| 3 +++ > drivers/gpu/drm/i915/i915_drv.h| 1 + > 3 files changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c > b/drivers/gpu/drm/i915/display/vlv_dsi.c > index f94025ec603a..792ef868b6af 100644 > --- a/drivers/gpu/drm/i915/display/vlv_dsi.c > +++ b/drivers/gpu/drm/i915/display/vlv_dsi.c > @@ -1949,6 +1949,9 @@ void vlv_dsi_init(struct drm_i915_private *dev_priv) > > vlv_dsi_add_properties(intel_connector); > > + /* Some BIOS-es fail to re-init the DSI panel on reboot if we turn it > off */ > + dev_priv->quirks |= QUIRK_SKIP_SHUTDOWN; > + > return; > > err_cleanup_connector: > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c > index 8e9cb44e66e5..92f2af55af6d 100644 > --- a/drivers/gpu/drm/i915/i915_drv.c > +++ b/drivers/gpu/drm/i915/i915_drv.c > @@ -1048,6 +1048,9 @@ static void intel_shutdown_encoders(struct > drm_i915_private *dev_priv) > > void i915_driver_shutdown(struct drm_i915_private *i915) > { > + if (i915->quirks & QUIRK_SKIP_SHUTDOWN) > + return; > + > disable_rpm_wakeref_asserts(&i915->runtime_pm); > > i915_gem_suspend(i915); > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h > index 26d69d06aa6d..272cd7cb22d4 100644 > --- a/drivers/gpu/drm/i915/i915_drv.h > +++ b/drivers/gpu/drm/i915/i915_drv.h > @@ -517,6 +517,7 @@ struct i915_psr { > #define QUIRK_PIN_SWIZZLED_PAGES (1<<5) > #define QUIRK_INCREASE_T12_DELAY (1<<6) > #define QUIRK_INCREASE_DDI_DISABLED_TIME (1<<7) > +#define QUIRK_SKIP_SHUTDOWN (1<<8) > > struct intel_fbdev; > struct intel_fbc_work; > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm: bridge: adv7511: Support I2S IEC958 encoded PCM format
Hey Sia, Thanks for the patch, it looks good to me. Reviewed-by: Robert Foss On Fri, 12 Mar 2021 at 10:09, Sia Jee Heng wrote: > > Support IEC958 encoded PCM format for ADV7511 so that ADV7511 HDMI > audio driver can accept the IEC958 data from the I2S input. > > Signed-off-by: Sia Jee Heng > --- > drivers/gpu/drm/bridge/adv7511/adv7511.h | 1 + > drivers/gpu/drm/bridge/adv7511/adv7511_audio.c | 6 ++ > 2 files changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h > b/drivers/gpu/drm/bridge/adv7511/adv7511.h > index a9bb734366ae..05e3abb5a0c9 100644 > --- a/drivers/gpu/drm/bridge/adv7511/adv7511.h > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h > @@ -191,6 +191,7 @@ > #define ADV7511_I2S_FORMAT_I2S 0 > #define ADV7511_I2S_FORMAT_RIGHT_J 1 > #define ADV7511_I2S_FORMAT_LEFT_J 2 > +#define ADV7511_I2S_IEC958_DIRECT 3 > > #define ADV7511_PACKET(p, x) ((p) * 0x20 + (x)) > #define ADV7511_PACKET_SDP(x) ADV7511_PACKET(0, x) > diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c > b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c > index 45838bd08d37..61f4a38e7d2b 100644 > --- a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c > +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c > @@ -101,6 +101,10 @@ static int adv7511_hdmi_hw_params(struct device *dev, > void *data, > case 20: > len = ADV7511_I2S_SAMPLE_LEN_20; > break; > + case 32: > + if (fmt->bit_fmt != SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE) > + return -EINVAL; > + fallthrough; > case 24: > len = ADV7511_I2S_SAMPLE_LEN_24; > break; > @@ -112,6 +116,8 @@ static int adv7511_hdmi_hw_params(struct device *dev, > void *data, > case HDMI_I2S: > audio_source = ADV7511_AUDIO_SOURCE_I2S; > i2s_format = ADV7511_I2S_FORMAT_I2S; > + if (fmt->bit_fmt == SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE) > + i2s_format = ADV7511_I2S_IEC958_DIRECT; > break; > case HDMI_RIGHT_J: > audio_source = ADV7511_AUDIO_SOURCE_I2S; > > base-commit: de066e116306baf3a6a62691ac63cfc0b1dabddb > -- > 2.18.0 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 1/2] drm/msm: fix shutdown hook in case GPU components failed to bind
From: Dmitry Baryshkov If GPU components have failed to bind, shutdown callback would fail with the following backtrace. Add safeguard check to stop that oops from happening and allow the board to reboot. [ 66.617046] Unable to handle kernel NULL pointer dereference at virtual address [ 66.626066] Mem abort info: [ 66.628939] ESR = 0x9606 [ 66.632088] EC = 0x25: DABT (current EL), IL = 32 bits [ 66.637542] SET = 0, FnV = 0 [ 66.640688] EA = 0, S1PTW = 0 [ 66.643924] Data abort info: [ 66.646889] ISV = 0, ISS = 0x0006 [ 66.650832] CM = 0, WnR = 0 [ 66.653890] user pgtable: 4k pages, 48-bit VAs, pgdp=000107f81000 [ 66.660505] [] pgd=000100bb2003, p4d=000100bb2003, pud=000100897003, pmd= [ 66.671398] Internal error: Oops: 9606 [#1] PREEMPT SMP [ 66.677115] Modules linked in: [ 66.680261] CPU: 6 PID: 352 Comm: reboot Not tainted 5.11.0-rc2-00309-g79e3faa756b2 #38 [ 66.688473] Hardware name: Qualcomm Technologies, Inc. Robotics RB5 (DT) [ 66.695347] pstate: 6045 (nZCv daif +PAN -UAO -TCO BTYPE=--) [ 66.701507] pc : msm_atomic_commit_tail+0x78/0x4e0 [ 66.706437] lr : commit_tail+0xa4/0x184 [ 66.710381] sp : 8000108f3af0 [ 66.713791] x29: 8000108f3af0 x28: 418c44337000 [ 66.719242] x27: x26: 418c40a24490 [ 66.724693] x25: d3a842a4f1a0 x24: 0008 [ 66.730146] x23: d3a84313f030 x22: 418c444ce000 [ 66.735598] x21: 418c408a4980 x20: [ 66.741049] x19: x18: 800010710fbc [ 66.746500] x17: 000c x16: 0001 [ 66.751954] x15: 00010008 x14: 0068 [ 66.757405] x13: 0001 x12: [ 66.762855] x11: 0001 x10: 09b0 [ 66.768306] x9 : d3a843192000 x8 : 418c44337000 [ 66.773757] x7 : x6 : a401b34e [ 66.779210] x5 : 00ff x4 : [ 66.784660] x3 : x2 : 418c444ce000 [ 66.790111] x1 : d3a841dce530 x0 : 418c444cf000 [ 66.795563] Call trace: [ 66.798075] msm_atomic_commit_tail+0x78/0x4e0 [ 66.802633] commit_tail+0xa4/0x184 [ 66.806217] drm_atomic_helper_commit+0x160/0x390 [ 66.811051] drm_atomic_commit+0x4c/0x60 [ 66.815082] drm_atomic_helper_disable_all+0x1f4/0x210 [ 66.820355] drm_atomic_helper_shutdown+0x80/0x130 [ 66.825276] msm_pdev_shutdown+0x14/0x20 [ 66.829303] platform_shutdown+0x28/0x40 [ 66.80] device_shutdown+0x158/0x330 [ 66.837357] kernel_restart+0x40/0xa0 [ 66.841122] __do_sys_reboot+0x228/0x250 [ 66.845148] __arm64_sys_reboot+0x28/0x34 [ 66.849264] el0_svc_common.constprop.0+0x74/0x190 [ 66.854187] do_el0_svc+0x24/0x90 [ 66.857595] el0_svc+0x14/0x20 [ 66.860739] el0_sync_handler+0x1a4/0x1b0 [ 66.864858] el0_sync+0x174/0x180 [ 66.868269] Code: 1ac020a0 2a000273 eb02007f 5401 (f9400285) [ 66.874525] ---[ end trace 20dedb2a3229fec8 ]--- Fixes: 9d5cbf5fe46e ("drm/msm: add shutdown support for display platform_driver") Signed-off-by: Dmitry Baryshkov Signed-off-by: Fabio Estevam --- drivers/gpu/drm/msm/msm_drv.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 94525ac76d4e..fd2ac54caf9f 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1311,6 +1311,10 @@ static int msm_pdev_remove(struct platform_device *pdev) static void msm_pdev_shutdown(struct platform_device *pdev) { struct drm_device *drm = platform_get_drvdata(pdev); + struct msm_drm_private *priv = drm ? drm->dev_private : NULL; + + if (!priv || !priv->kms) + return; drm_atomic_helper_shutdown(drm); } -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/2] drm/msm: Fix suspend/resume on i.MX5
When putting iMX5 into suspend, the following flow is observed: [ 70.023427] [] (msm_atomic_commit_tail) from [] (commit_tail+0x9c/0x18c) [ 70.031890] [] (commit_tail) from [] (drm_atomic_helper_commit+0x1a0/0x1d4) [ 70.040627] [] (drm_atomic_helper_commit) from [] (drm_atomic_helper_disable_all+0x1c4/0x1d4) [ 70.050913] [] (drm_atomic_helper_disable_all) from [] (drm_atomic_helper_suspend+0xb8/0x170) [ 70.061198] [] (drm_atomic_helper_suspend) from [] (drm_mode_config_helper_suspend+0x24/0x58) In the i.MX5 case, priv->kms is not populated (as i.MX5 does not use any of the Qualcomm display controllers), causing a NULL pointer dereference in msm_atomic_commit_tail(): [ 24.268964] 8<--- cut here --- [ 24.274602] Unable to handle kernel NULL pointer dereference at virtual address [ 24.283434] pgd = (ptrval) [ 24.286387] [] *pgd=ca212831 [ 24.290788] Internal error: Oops: 17 [#1] SMP ARM [ 24.295609] Modules linked in: [ 24.298777] CPU: 0 PID: 197 Comm: init Not tainted 5.11.0-rc2-next-20210111 #333 [ 24.306276] Hardware name: Freescale i.MX53 (Device Tree Support) [ 24.312442] PC is at msm_atomic_commit_tail+0x54/0xb9c [ 24.317743] LR is at commit_tail+0xa4/0x1b0 Fix the problem by calling drm_mode_config_helper_suspend/resume() only when priv->kms is available. Fixes: ca8199f13498 ("drm/msm/dpu: ensure device suspend happens during PM sleep") Signed-off-by: Fabio Estevam --- drivers/gpu/drm/msm/msm_drv.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index fd2ac54caf9f..a5c6b8c23336 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -1072,6 +1072,10 @@ static int __maybe_unused msm_pm_resume(struct device *dev) static int __maybe_unused msm_pm_prepare(struct device *dev) { struct drm_device *ddev = dev_get_drvdata(dev); + struct msm_drm_private *priv = ddev ? ddev->dev_private : NULL; + + if (!priv || !priv->kms) + return 0; return drm_mode_config_helper_suspend(ddev); } @@ -1079,6 +1083,10 @@ static int __maybe_unused msm_pm_prepare(struct device *dev) static void __maybe_unused msm_pm_complete(struct device *dev) { struct drm_device *ddev = dev_get_drvdata(dev); + struct msm_drm_private *priv = ddev ? ddev->dev_private : NULL; + + if (!priv || !priv->kms) + return; drm_mode_config_helper_resume(ddev); } -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] gpu/drm/msm: fix shutdown hook in case GPU components failed to bind
On Fri, Mar 19, 2021 at 12:13 PM Fabio Estevam wrote: > Thanks for the feedback. > I will follow the same approach for fixing the suspend/resume path then. > > Let me test it and then I will re-submit Dmitry's patch and the one > for suspend/resume as part of a patch series. This approach works here for the suspend/resume path too. I have just submitted the series, thanks. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/ttm: stop warning on TT shrinker failure
[AMD Official Use Only - Internal Distribution Only] + Leo From: amd-gfx on behalf of Christian König Sent: Friday, March 19, 2021 10:08 AM To: Liu, Leo ; amd-...@lists.freedesktop.org ; dri-devel@lists.freedesktop.org Subject: [PATCH] drm/ttm: stop warning on TT shrinker failure Don't print a warning when we fail to allocate a page for swapping things out. Also rely on memalloc_nofs_save/memalloc_nofs_restore instead of GFP_NOFS. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_tt.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 2f0833c98d2c..86fa3e82dacc 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -369,7 +369,7 @@ static unsigned long ttm_tt_shrinker_scan(struct shrinker *shrink, }; int ret; - ret = ttm_bo_swapout(&ctx, GFP_NOFS); + ret = ttm_bo_swapout(&ctx, GFP_KERNEL | __GFP_NOWARN); return ret < 0 ? SHRINK_EMPTY : ret; } @@ -389,10 +389,13 @@ static unsigned long ttm_tt_shrinker_count(struct shrinker *shrink, static int ttm_tt_debugfs_shrink_show(struct seq_file *m, void *data) { struct shrink_control sc = { .gfp_mask = GFP_KERNEL }; + unsigned int flags; fs_reclaim_acquire(GFP_KERNEL); + flags = memalloc_nofs_save(); seq_printf(m, "%lu/%lu\n", ttm_tt_shrinker_count(&mm_shrinker, &sc), ttm_tt_shrinker_scan(&mm_shrinker, &sc)); + memalloc_nofs_restore(flags); fs_reclaim_release(GFP_KERNEL); return 0; -- 2.25.1 ___ amd-gfx mailing list amd-...@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C70aef4974dfe465a06a308d8eae08eb3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517597539809703%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=kvyinv9FPakf76dvXF0pzfeCpclxAo3L4Ufkf6%2B6%2FCc%3D&reserved=0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 14/19] drm/nouveau/dispnv50/headc57d: Make local function 'headc57d_olut' static
Reviewed-by: Lyude Paul On Fri, 2021-03-19 at 08:24 +, Lee Jones wrote: > Fixes the following W=1 kernel build warning(s): > > drivers/gpu/drm/nouveau/dispnv50/headc57d.c:173:1: warning: no previous > prototype for ‘headc57d_olut’ [-Wmissing-prototypes] > > Cc: Ben Skeggs > Cc: David Airlie > Cc: Daniel Vetter > Cc: Lyude Paul > Cc: dri-devel@lists.freedesktop.org > Cc: nouv...@lists.freedesktop.org > Signed-off-by: Lee Jones > --- > drivers/gpu/drm/nouveau/dispnv50/headc57d.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/dispnv50/headc57d.c > b/drivers/gpu/drm/nouveau/dispnv50/headc57d.c > index fd51527b56b83..bdcfd240d61c8 100644 > --- a/drivers/gpu/drm/nouveau/dispnv50/headc57d.c > +++ b/drivers/gpu/drm/nouveau/dispnv50/headc57d.c > @@ -169,7 +169,7 @@ headc57d_olut_load(struct drm_color_lut *in, int size, > void __iomem *mem) > writew(readw(mem - 4), mem + 4); > } > > -bool > +static bool > headc57d_olut(struct nv50_head *head, struct nv50_head_atom *asyh, int size) > { > if (size != 0 && size != 256 && size != 1024) -- Sincerely, Lyude Paul (she/her) Software Engineer at Red Hat Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've asked me a question, are waiting for a review/merge on a patch, etc. and I haven't responded in a while, please feel free to send me another email to check on my status. I don't bite! ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/ttm: stop warning on TT shrinker failure
On Fri, Mar 19, 2021 at 03:08:57PM +0100, Christian König wrote: > Don't print a warning when we fail to allocate a page for swapping things out. > > Also rely on memalloc_nofs_save/memalloc_nofs_restore instead of GFP_NOFS. Uh this part doesn't make sense. Especially since you only do it for the debugfs file, not in general. Which means you've just completely broken the shrinker. If this is just to paper over the seq_printf doing the wrong allocations, then just move that out from under the fs_reclaim_acquire/release part. __GFP_NOWARN should be there indeed I think. -Daniel > > Signed-off-by: Christian König > --- > drivers/gpu/drm/ttm/ttm_tt.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c > index 2f0833c98d2c..86fa3e82dacc 100644 > --- a/drivers/gpu/drm/ttm/ttm_tt.c > +++ b/drivers/gpu/drm/ttm/ttm_tt.c > @@ -369,7 +369,7 @@ static unsigned long ttm_tt_shrinker_scan(struct shrinker > *shrink, > }; > int ret; > > - ret = ttm_bo_swapout(&ctx, GFP_NOFS); > + ret = ttm_bo_swapout(&ctx, GFP_KERNEL | __GFP_NOWARN); > return ret < 0 ? SHRINK_EMPTY : ret; > } > > @@ -389,10 +389,13 @@ static unsigned long ttm_tt_shrinker_count(struct > shrinker *shrink, > static int ttm_tt_debugfs_shrink_show(struct seq_file *m, void *data) > { > struct shrink_control sc = { .gfp_mask = GFP_KERNEL }; > + unsigned int flags; > > fs_reclaim_acquire(GFP_KERNEL); > + flags = memalloc_nofs_save(); > seq_printf(m, "%lu/%lu\n", ttm_tt_shrinker_count(&mm_shrinker, &sc), > ttm_tt_shrinker_scan(&mm_shrinker, &sc)); > + memalloc_nofs_restore(flags); > fs_reclaim_release(GFP_KERNEL); > > return 0; > -- > 2.25.1 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [RESEND 00/53] Rid GPU from W=1 warnings
On Fri, Mar 19, 2021 at 08:24:07AM +, Lee Jones wrote: > On Thu, 18 Mar 2021, Daniel Vetter wrote: > > > On Wed, Mar 17, 2021 at 9:32 PM Daniel Vetter wrote: > > > > > > On Wed, Mar 17, 2021 at 9:17 AM Lee Jones wrote: > > > > > > > > On Thu, 11 Mar 2021, Lee Jones wrote: > > > > > > > > > On Thu, 11 Mar 2021, Daniel Vetter wrote: > > > > > > > > > > > On Mon, Mar 08, 2021 at 09:19:32AM +, Lee Jones wrote: > > > > > > > On Fri, 05 Mar 2021, Roland Scheidegger wrote: > > > > > > > > > > > > > > > The vmwgfx ones look all good to me, so for > > > > > > > > 23-53: Reviewed-by: Roland Scheidegger > > > > > > > > That said, they were already signed off by Zack, so not sure > > > > > > > > what > > > > > > > > happened here. > > > > > > > > > > > > > > Yes, they were accepted at one point, then dropped without a > > > > > > > reason. > > > > > > > > > > > > > > Since I rebased onto the latest -next, I had to pluck them back > > > > > > > out of > > > > > > > a previous one. > > > > > > > > > > > > They should show up in linux-next again. We merge patches for next > > > > > > merge > > > > > > window even during the current merge window, but need to make sure > > > > > > they > > > > > > don't pollute linux-next. Occasionally the cut off is wrong so > > > > > > patches > > > > > > show up, and then get pulled again. > > > > > > > > > > > > Unfortunately especially the 5.12 merge cycle was very wobbly due > > > > > > to some > > > > > > confusion here. But your patches should all be in linux-next again > > > > > > (they > > > > > > are queued up for 5.13 in drm-misc-next, I checked that). > > > > > > > > > > > > Sorry for the confusion here. > > > > > > > > > > Oh, I see. Well so long as they don't get dropped, I'll be happy. > > > > > > > > > > Thanks for the explanation Daniel > > > > > > > > After rebasing today, all of my GPU patches have remained. Would > > > > someone be kind enough to check that everything is still in order > > > > please? > > > > > > It's still broken somehow. I've kiced Maxime and Maarten again, > > > they're also on this thread. > > > > You're patches have made it into drm-next meanwhile, so they should > > show up in linux-next through that tree at least. Except if that one > > also has some trouble. > > Thanks for letting me know. > > I see some patches made it back in, others didn't. > > I'll resend the stragglers - bear with. The vmwgfx ones should all be back, the others I guess just werent ever applied. I'll vacuum them all up if you resend. Apologies for the wobbly ride. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/19] drm/amd/display/dc/calcs/dce_calcs: Move some large variables from the stack to the heap
+ Harry, Nick On Fri, Mar 19, 2021 at 4:24 AM Lee Jones wrote: > > Fixes the following W=1 kernel build warning(s): > > drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function > ‘calculate_bandwidth’: > drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:2016:1: warning: > the frame size of 1216 bytes is larger than 1024 bytes [-Wframe-larger-than=] > > Cc: Harry Wentland > Cc: Leo Li > Cc: Alex Deucher > Cc: "Christian König" > Cc: David Airlie > Cc: Daniel Vetter > Cc: Colin Ian King > Cc: amd-...@lists.freedesktop.org > Cc: dri-devel@lists.freedesktop.org > Signed-off-by: Lee Jones > --- > .../gpu/drm/amd/display/dc/calcs/dce_calcs.c | 32 --- > 1 file changed, 28 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c > b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c > index e633f8a51edb6..9d8f2505a61c2 100644 > --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c > +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c > @@ -98,16 +98,16 @@ static void calculate_bandwidth( > int32_t num_cursor_lines; > > int32_t i, j, k; > - struct bw_fixed yclk[3]; > - struct bw_fixed sclk[8]; > + struct bw_fixed *yclk; > + struct bw_fixed *sclk; > bool d0_underlay_enable; > bool d1_underlay_enable; > bool fbc_enabled; > bool lpt_enabled; > enum bw_defines sclk_message; > enum bw_defines yclk_message; > - enum bw_defines tiling_mode[maximum_number_of_surfaces]; > - enum bw_defines surface_type[maximum_number_of_surfaces]; > + enum bw_defines *tiling_mode; > + enum bw_defines *surface_type; > enum bw_defines voltage; > enum bw_defines pipe_check; > enum bw_defines hsr_check; > @@ -122,6 +122,22 @@ static void calculate_bandwidth( > int32_t number_of_displays_enabled_with_margin = 0; > int32_t number_of_aligned_displays_with_no_margin = 0; > > + yclk = kcalloc(3, sizeof(*yclk), GFP_KERNEL); > + if (!yclk) > + return; > + > + sclk = kcalloc(8, sizeof(*sclk), GFP_KERNEL); > + if (!sclk) > + goto free_yclk; > + > + tiling_mode = kcalloc(maximum_number_of_surfaces, > sizeof(*tiling_mode), GFP_KERNEL); > + if (!tiling_mode) > + goto free_sclk; > + > + surface_type = kcalloc(maximum_number_of_surfaces, > sizeof(*surface_type), GFP_KERNEL); > + if (!surface_type) > + goto free_tiling_mode; > + Harry or Nick can correct me if I'm wrong, but for this patch and the next one, I think this can be called from an atomic context. Alex > yclk[low] = vbios->low_yclk; > yclk[mid] = vbios->mid_yclk; > yclk[high] = vbios->high_yclk; > @@ -2013,6 +2029,14 @@ static void calculate_bandwidth( > } > } > } > + > + kfree(surface_type); > +free_tiling_mode: > + kfree(tiling_mode); > +free_yclk: > + kfree(yclk); > +free_sclk: > + kfree(sclk); > } > > > /*** > -- > 2.27.0 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH V2] drm/bridge: lvds-codec: Add support for pixel data sampling edge select
On 1/24/21 6:04 PM, Marek Vasut wrote: On 12/24/20 7:18 AM, Marek Vasut wrote: The OnSemi FIN3385 Parallel-to-LVDS encoder has a dedicated input line to select input pixel data sampling edge. Add DT property "pixelclk-active", same as the one used by display timings, and configure bus flags based on this DT property. Bump ? Any news on this patch ? ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 08/19] drm/amd/display/dc/dce80/dce80_resource: Make local functions static
On Fri, Mar 19, 2021 at 4:24 AM Lee Jones wrote: > > Fixes the following W=1 kernel build warning(s): > > drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:527:17: > warning: no previous prototype for ‘dce80_aux_engine_create’ > [-Wmissing-prototypes] > drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:565:20: > warning: no previous prototype for ‘dce80_i2c_hw_create’ > [-Wmissing-prototypes] > drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:581:20: > warning: no previous prototype for ‘dce80_i2c_sw_create’ > [-Wmissing-prototypes] > drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:715:22: > warning: no previous prototype for ‘dce80_link_encoder_create’ > [-Wmissing-prototypes] > drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:754:22: > warning: no previous prototype for ‘dce80_clock_source_create’ > [-Wmissing-prototypes] > drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:778:6: > warning: no previous prototype for ‘dce80_clock_source_destroy’ > [-Wmissing-prototypes] > drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:868:6: > warning: no previous prototype for ‘dce80_validate_bandwidth’ > [-Wmissing-prototypes] > drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:913:16: > warning: no previous prototype for ‘dce80_validate_global’ > [-Wmissing-prototypes] > > Cc: Harry Wentland > Cc: Leo Li > Cc: Alex Deucher > Cc: "Christian König" > Cc: David Airlie > Cc: Daniel Vetter > Cc: Anthony Koo > Cc: amd-...@lists.freedesktop.org > Cc: dri-devel@lists.freedesktop.org > Signed-off-by: Lee Jones Applied. Thanks! Alex > --- > .../drm/amd/display/dc/dce80/dce80_resource.c| 16 > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c > b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c > index 612450f992782..725d92e40cd30 100644 > --- a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c > +++ b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c > @@ -526,7 +526,7 @@ static struct output_pixel_processor *dce80_opp_create( > return &opp->base; > } > > -struct dce_aux *dce80_aux_engine_create( > +static struct dce_aux *dce80_aux_engine_create( > struct dc_context *ctx, > uint32_t inst) > { > @@ -564,7 +564,7 @@ static const struct dce_i2c_mask i2c_masks = { > I2C_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(_MASK) > }; > > -struct dce_i2c_hw *dce80_i2c_hw_create( > +static struct dce_i2c_hw *dce80_i2c_hw_create( > struct dc_context *ctx, > uint32_t inst) > { > @@ -580,7 +580,7 @@ struct dce_i2c_hw *dce80_i2c_hw_create( > return dce_i2c_hw; > } > > -struct dce_i2c_sw *dce80_i2c_sw_create( > +static struct dce_i2c_sw *dce80_i2c_sw_create( > struct dc_context *ctx) > { > struct dce_i2c_sw *dce_i2c_sw = > @@ -714,7 +714,7 @@ static const struct encoder_feature_support > link_enc_feature = { > .flags.bits.IS_TPS3_CAPABLE = true > }; > > -struct link_encoder *dce80_link_encoder_create( > +static struct link_encoder *dce80_link_encoder_create( > const struct encoder_init_data *enc_init_data) > { > struct dce110_link_encoder *enc110 = > @@ -753,7 +753,7 @@ static struct panel_cntl *dce80_panel_cntl_create(const > struct panel_cntl_init_d > return &panel_cntl->base; > } > > -struct clock_source *dce80_clock_source_create( > +static struct clock_source *dce80_clock_source_create( > struct dc_context *ctx, > struct dc_bios *bios, > enum clock_source_id id, > @@ -777,7 +777,7 @@ struct clock_source *dce80_clock_source_create( > return NULL; > } > > -void dce80_clock_source_destroy(struct clock_source **clk_src) > +static void dce80_clock_source_destroy(struct clock_source **clk_src) > { > kfree(TO_DCE110_CLK_SRC(*clk_src)); > *clk_src = NULL; > @@ -867,7 +867,7 @@ static void dce80_resource_destruct(struct > dce110_resource_pool *pool) > } > } > > -bool dce80_validate_bandwidth( > +static bool dce80_validate_bandwidth( > struct dc *dc, > struct dc_state *context, > bool fast_validate) > @@ -912,7 +912,7 @@ static bool dce80_validate_surface_sets( > return true; > } > > -enum dc_status dce80_validate_global( > +static enum dc_status dce80_validate_global( > struct dc *dc, > struct dc_state *context) > { > -- > 2.27.0 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 08/19] drm/amd/display/dc/dce80/dce80_resource: Make local functions static
On 2021-03-19 4:24 a.m., Lee Jones wrote: Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:527:17: warning: no previous prototype for ‘dce80_aux_engine_create’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:565:20: warning: no previous prototype for ‘dce80_i2c_hw_create’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:581:20: warning: no previous prototype for ‘dce80_i2c_sw_create’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:715:22: warning: no previous prototype for ‘dce80_link_encoder_create’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:754:22: warning: no previous prototype for ‘dce80_clock_source_create’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:778:6: warning: no previous prototype for ‘dce80_clock_source_destroy’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:868:6: warning: no previous prototype for ‘dce80_validate_bandwidth’ [-Wmissing-prototypes] drivers/gpu/drm/amd/amdgpu/../display/dc/dce80/dce80_resource.c:913:16: warning: no previous prototype for ‘dce80_validate_global’ [-Wmissing-prototypes] Cc: Harry Wentland Cc: Leo Li Cc: Alex Deucher Cc: "Christian König" Cc: David Airlie Cc: Daniel Vetter Cc: Anthony Koo Cc: amd-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones Reviewed-by: Harry Wentland Harry --- .../drm/amd/display/dc/dce80/dce80_resource.c| 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c index 612450f992782..725d92e40cd30 100644 --- a/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c @@ -526,7 +526,7 @@ static struct output_pixel_processor *dce80_opp_create( return &opp->base; } -struct dce_aux *dce80_aux_engine_create( +static struct dce_aux *dce80_aux_engine_create( struct dc_context *ctx, uint32_t inst) { @@ -564,7 +564,7 @@ static const struct dce_i2c_mask i2c_masks = { I2C_COMMON_MASK_SH_LIST_DCE_COMMON_BASE(_MASK) }; -struct dce_i2c_hw *dce80_i2c_hw_create( +static struct dce_i2c_hw *dce80_i2c_hw_create( struct dc_context *ctx, uint32_t inst) { @@ -580,7 +580,7 @@ struct dce_i2c_hw *dce80_i2c_hw_create( return dce_i2c_hw; } -struct dce_i2c_sw *dce80_i2c_sw_create( +static struct dce_i2c_sw *dce80_i2c_sw_create( struct dc_context *ctx) { struct dce_i2c_sw *dce_i2c_sw = @@ -714,7 +714,7 @@ static const struct encoder_feature_support link_enc_feature = { .flags.bits.IS_TPS3_CAPABLE = true }; -struct link_encoder *dce80_link_encoder_create( +static struct link_encoder *dce80_link_encoder_create( const struct encoder_init_data *enc_init_data) { struct dce110_link_encoder *enc110 = @@ -753,7 +753,7 @@ static struct panel_cntl *dce80_panel_cntl_create(const struct panel_cntl_init_d return &panel_cntl->base; } -struct clock_source *dce80_clock_source_create( +static struct clock_source *dce80_clock_source_create( struct dc_context *ctx, struct dc_bios *bios, enum clock_source_id id, @@ -777,7 +777,7 @@ struct clock_source *dce80_clock_source_create( return NULL; } -void dce80_clock_source_destroy(struct clock_source **clk_src) +static void dce80_clock_source_destroy(struct clock_source **clk_src) { kfree(TO_DCE110_CLK_SRC(*clk_src)); *clk_src = NULL; @@ -867,7 +867,7 @@ static void dce80_resource_destruct(struct dce110_resource_pool *pool) } } -bool dce80_validate_bandwidth( +static bool dce80_validate_bandwidth( struct dc *dc, struct dc_state *context, bool fast_validate) @@ -912,7 +912,7 @@ static bool dce80_validate_surface_sets( return true; } -enum dc_status dce80_validate_global( +static enum dc_status dce80_validate_global( struct dc *dc, struct dc_state *context) { ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/19] drm/amd/display/dc/calcs/dce_calcs: Move some large variables from the stack to the heap
On 2021-03-19 2:13 p.m., Alex Deucher wrote: + Harry, Nick On Fri, Mar 19, 2021 at 4:24 AM Lee Jones wrote: Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function ‘calculate_bandwidth’: drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:2016:1: warning: the frame size of 1216 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Harry Wentland Cc: Leo Li Cc: Alex Deucher Cc: "Christian König" Cc: David Airlie Cc: Daniel Vetter Cc: Colin Ian King Cc: amd-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones --- .../gpu/drm/amd/display/dc/calcs/dce_calcs.c | 32 --- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c index e633f8a51edb6..9d8f2505a61c2 100644 --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c @@ -98,16 +98,16 @@ static void calculate_bandwidth( int32_t num_cursor_lines; int32_t i, j, k; - struct bw_fixed yclk[3]; - struct bw_fixed sclk[8]; + struct bw_fixed *yclk; + struct bw_fixed *sclk; bool d0_underlay_enable; bool d1_underlay_enable; bool fbc_enabled; bool lpt_enabled; enum bw_defines sclk_message; enum bw_defines yclk_message; - enum bw_defines tiling_mode[maximum_number_of_surfaces]; - enum bw_defines surface_type[maximum_number_of_surfaces]; + enum bw_defines *tiling_mode; + enum bw_defines *surface_type; enum bw_defines voltage; enum bw_defines pipe_check; enum bw_defines hsr_check; @@ -122,6 +122,22 @@ static void calculate_bandwidth( int32_t number_of_displays_enabled_with_margin = 0; int32_t number_of_aligned_displays_with_no_margin = 0; + yclk = kcalloc(3, sizeof(*yclk), GFP_KERNEL); + if (!yclk) + return; + + sclk = kcalloc(8, sizeof(*sclk), GFP_KERNEL); + if (!sclk) + goto free_yclk; + + tiling_mode = kcalloc(maximum_number_of_surfaces, sizeof(*tiling_mode), GFP_KERNEL); + if (!tiling_mode) + goto free_sclk; + + surface_type = kcalloc(maximum_number_of_surfaces, sizeof(*surface_type), GFP_KERNEL); + if (!surface_type) + goto free_tiling_mode; + Harry or Nick can correct me if I'm wrong, but for this patch and the next one, I think this can be called from an atomic context. From what I can see this doesn't seem the case. If I'm missing something someone please correct me. This and the next (06/19) patch are both Reviewed-by: Harry Wentland Harry Alex yclk[low] = vbios->low_yclk; yclk[mid] = vbios->mid_yclk; yclk[high] = vbios->high_yclk; @@ -2013,6 +2029,14 @@ static void calculate_bandwidth( } } } + + kfree(surface_type); +free_tiling_mode: + kfree(tiling_mode); +free_yclk: + kfree(yclk); +free_sclk: + kfree(sclk); } /*** -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel> ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/19] drm/amd/display/dc/calcs/dce_calcs: Move some large variables from the stack to the heap
On Fri, Mar 19, 2021 at 2:26 PM Harry Wentland wrote: > > On 2021-03-19 2:13 p.m., Alex Deucher wrote: > > + Harry, Nick > > > > On Fri, Mar 19, 2021 at 4:24 AM Lee Jones wrote: > >> > >> Fixes the following W=1 kernel build warning(s): > >> > >> drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function > >> ‘calculate_bandwidth’: > >> drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:2016:1: > >> warning: the frame size of 1216 bytes is larger than 1024 bytes > >> [-Wframe-larger-than=] > >> > >> Cc: Harry Wentland > >> Cc: Leo Li > >> Cc: Alex Deucher > >> Cc: "Christian König" > >> Cc: David Airlie > >> Cc: Daniel Vetter > >> Cc: Colin Ian King > >> Cc: amd-...@lists.freedesktop.org > >> Cc: dri-devel@lists.freedesktop.org > >> Signed-off-by: Lee Jones > >> --- > >> .../gpu/drm/amd/display/dc/calcs/dce_calcs.c | 32 --- > >> 1 file changed, 28 insertions(+), 4 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c > >> b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c > >> index e633f8a51edb6..9d8f2505a61c2 100644 > >> --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c > >> +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c > >> @@ -98,16 +98,16 @@ static void calculate_bandwidth( > >> int32_t num_cursor_lines; > >> > >> int32_t i, j, k; > >> - struct bw_fixed yclk[3]; > >> - struct bw_fixed sclk[8]; > >> + struct bw_fixed *yclk; > >> + struct bw_fixed *sclk; > >> bool d0_underlay_enable; > >> bool d1_underlay_enable; > >> bool fbc_enabled; > >> bool lpt_enabled; > >> enum bw_defines sclk_message; > >> enum bw_defines yclk_message; > >> - enum bw_defines tiling_mode[maximum_number_of_surfaces]; > >> - enum bw_defines surface_type[maximum_number_of_surfaces]; > >> + enum bw_defines *tiling_mode; > >> + enum bw_defines *surface_type; > >> enum bw_defines voltage; > >> enum bw_defines pipe_check; > >> enum bw_defines hsr_check; > >> @@ -122,6 +122,22 @@ static void calculate_bandwidth( > >> int32_t number_of_displays_enabled_with_margin = 0; > >> int32_t number_of_aligned_displays_with_no_margin = 0; > >> > >> + yclk = kcalloc(3, sizeof(*yclk), GFP_KERNEL); > >> + if (!yclk) > >> + return; > >> + > >> + sclk = kcalloc(8, sizeof(*sclk), GFP_KERNEL); > >> + if (!sclk) > >> + goto free_yclk; > >> + > >> + tiling_mode = kcalloc(maximum_number_of_surfaces, > >> sizeof(*tiling_mode), GFP_KERNEL); > >> + if (!tiling_mode) > >> + goto free_sclk; > >> + > >> + surface_type = kcalloc(maximum_number_of_surfaces, > >> sizeof(*surface_type), GFP_KERNEL); > >> + if (!surface_type) > >> + goto free_tiling_mode; > >> + > > > > > > Harry or Nick can correct me if I'm wrong, but for this patch and the > > next one, I think this can be called from an atomic context. > > > > From what I can see this doesn't seem the case. If I'm missing > something someone please correct me. > > This and the next (06/19) patch are both > Reviewed-by: Harry Wentland Thanks. I've applied them. Alex > > Harry > > > Alex > > > >> yclk[low] = vbios->low_yclk; > >> yclk[mid] = vbios->mid_yclk; > >> yclk[high] = vbios->high_yclk; > >> @@ -2013,6 +2029,14 @@ static void calculate_bandwidth( > >> } > >> } > >> } > >> + > >> + kfree(surface_type); > >> +free_tiling_mode: > >> + kfree(tiling_mode); > >> +free_yclk: > >> + kfree(yclk); > >> +free_sclk: > >> + kfree(sclk); > >> } > >> > >> > >> /*** > >> -- > >> 2.27.0 > >> > >> ___ > >> dri-devel mailing list > >> dri-devel@lists.freedesktop.org > >> https://lists.freedesktop.org/mailman/listinfo/dri-devel> ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/19] drm/amd/display/dc/calcs/dce_calcs: Move some large variables from the stack to the heap
Am 19.03.21 um 19:26 schrieb Harry Wentland: On 2021-03-19 2:13 p.m., Alex Deucher wrote: + Harry, Nick On Fri, Mar 19, 2021 at 4:24 AM Lee Jones wrote: Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function ‘calculate_bandwidth’: drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:2016:1: warning: the frame size of 1216 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Harry Wentland Cc: Leo Li Cc: Alex Deucher Cc: "Christian König" Cc: David Airlie Cc: Daniel Vetter Cc: Colin Ian King Cc: amd-...@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones --- .../gpu/drm/amd/display/dc/calcs/dce_calcs.c | 32 --- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c index e633f8a51edb6..9d8f2505a61c2 100644 --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c @@ -98,16 +98,16 @@ static void calculate_bandwidth( int32_t num_cursor_lines; int32_t i, j, k; - struct bw_fixed yclk[3]; - struct bw_fixed sclk[8]; + struct bw_fixed *yclk; + struct bw_fixed *sclk; bool d0_underlay_enable; bool d1_underlay_enable; bool fbc_enabled; bool lpt_enabled; enum bw_defines sclk_message; enum bw_defines yclk_message; - enum bw_defines tiling_mode[maximum_number_of_surfaces]; - enum bw_defines surface_type[maximum_number_of_surfaces]; + enum bw_defines *tiling_mode; + enum bw_defines *surface_type; enum bw_defines voltage; enum bw_defines pipe_check; enum bw_defines hsr_check; @@ -122,6 +122,22 @@ static void calculate_bandwidth( int32_t number_of_displays_enabled_with_margin = 0; int32_t number_of_aligned_displays_with_no_margin = 0; + yclk = kcalloc(3, sizeof(*yclk), GFP_KERNEL); + if (!yclk) + return; + + sclk = kcalloc(8, sizeof(*sclk), GFP_KERNEL); + if (!sclk) + goto free_yclk; + + tiling_mode = kcalloc(maximum_number_of_surfaces, sizeof(*tiling_mode), GFP_KERNEL); + if (!tiling_mode) + goto free_sclk; + + surface_type = kcalloc(maximum_number_of_surfaces, sizeof(*surface_type), GFP_KERNEL); + if (!surface_type) + goto free_tiling_mode; + Harry or Nick can correct me if I'm wrong, but for this patch and the next one, I think this can be called from an atomic context. From what I can see this doesn't seem the case. If I'm missing something someone please correct me. Have you taken into account that using FP functions require atomic context as well? We had quite a bunch of problems with that and had to replace some GFP_KERNEL with GFP_ATOMIC in the DC code because of this. Could of course be that this code here isn't affected by that, but better save than sorry. Christian. This and the next (06/19) patch are both Reviewed-by: Harry Wentland Harry Alex yclk[low] = vbios->low_yclk; yclk[mid] = vbios->mid_yclk; yclk[high] = vbios->high_yclk; @@ -2013,6 +2029,14 @@ static void calculate_bandwidth( } } } + + kfree(surface_type); +free_tiling_mode: + kfree(tiling_mode); +free_yclk: + kfree(yclk); +free_sclk: + kfree(sclk); } /*** -- 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel> ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/ttm: stop warning on TT shrinker failure
Am 19.03.21 um 18:52 schrieb Daniel Vetter: On Fri, Mar 19, 2021 at 03:08:57PM +0100, Christian König wrote: Don't print a warning when we fail to allocate a page for swapping things out. Also rely on memalloc_nofs_save/memalloc_nofs_restore instead of GFP_NOFS. Uh this part doesn't make sense. Especially since you only do it for the debugfs file, not in general. Which means you've just completely broken the shrinker. Are you sure? My impression is that GFP_NOFS should now work much more out of the box with the memalloc_nofs_save()/memalloc_nofs_restore(). If this is just to paper over the seq_printf doing the wrong allocations, then just move that out from under the fs_reclaim_acquire/release part. No, that wasn't the problem. We have just seen to many failures to allocate pages for swapout and I think that would improve this because in a lot of cases we can then immediately swap things out instead of having to rely on upper layers. Regards, Christian. __GFP_NOWARN should be there indeed I think. -Daniel Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_tt.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 2f0833c98d2c..86fa3e82dacc 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -369,7 +369,7 @@ static unsigned long ttm_tt_shrinker_scan(struct shrinker *shrink, }; int ret; - ret = ttm_bo_swapout(&ctx, GFP_NOFS); + ret = ttm_bo_swapout(&ctx, GFP_KERNEL | __GFP_NOWARN); return ret < 0 ? SHRINK_EMPTY : ret; } @@ -389,10 +389,13 @@ static unsigned long ttm_tt_shrinker_count(struct shrinker *shrink, static int ttm_tt_debugfs_shrink_show(struct seq_file *m, void *data) { struct shrink_control sc = { .gfp_mask = GFP_KERNEL }; + unsigned int flags; fs_reclaim_acquire(GFP_KERNEL); + flags = memalloc_nofs_save(); seq_printf(m, "%lu/%lu\n", ttm_tt_shrinker_count(&mm_shrinker, &sc), ttm_tt_shrinker_scan(&mm_shrinker, &sc)); + memalloc_nofs_restore(flags); fs_reclaim_release(GFP_KERNEL); return 0; -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2] drm/etnaviv: add HWDB entry for GC7000 rev 6204
From: Sascha Hauer This is the 3D GPU found on the i.MX8MP SoC. The feature bits are taken from the NXP downstream kernel driver 6.4.3.p1.305572. Signed-off-by: Sascha Hauer Signed-off-by: Lucas Stach --- drivers/gpu/drm/etnaviv/etnaviv_hwdb.c | 31 ++ 1 file changed, 31 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c b/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c index 167971a09be7..dfc0f536b3b9 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c @@ -37,6 +37,37 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { .minor_features10 = 0x0, .minor_features11 = 0x0, }, + { + .model = 0x7000, + .revision = 0x6204, + .product_id = ~0U, + .customer_id = ~0U, + .eco_id = 0, + .stream_count = 16, + .register_max = 64, + .thread_count = 512, + .shader_core_count = 2, + .vertex_cache_size = 16, + .vertex_output_buffer_size = 1024, + .pixel_pipes = 1, + .instruction_count = 512, + .num_constants = 320, + .buffer_size = 0, + .varyings_count = 16, + .features = 0xe0287c8d, + .minor_features0 = 0xc1589eff, + .minor_features1 = 0xfefbfad9, + .minor_features2 = 0xeb9d4fbf, + .minor_features3 = 0xedfffced, + .minor_features4 = 0xdb0dafc7, + .minor_features5 = 0x3b5ac333, + .minor_features6 = 0xfcce6000, + .minor_features7 = 0xfffbfa6f, + .minor_features8 = 0x00e10ef3, + .minor_features9 = 0x04c8003c, + .minor_features10 = 0x4060, + .minor_features11 = 0x0024, + }, { .model = 0x7000, .revision = 0x6214, -- 2.29.2 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel