Re: [PATCH v4, 25/33] drm/mediatek: add clock property check before get it
Hi, Yongqiang: On Tue, 2019-07-09 at 06:34 +0800, yongqiang@mediatek.com wrote: > From: Yongqiang Niu > > This patch add clock property check before get it > > Signed-off-by: Yongqiang Niu > --- > drivers/gpu/drm/mediatek/mtk_drm_ddp.c | 10 ++ > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c > b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c > index c57e7ab..a9d3e27 100644 > --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp.c > +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp.c > @@ -668,10 +668,12 @@ static int mtk_ddp_probe(struct platform_device *pdev) > for (i = 0; i < 10; i++) > ddp->mutex[i].id = i; > > - ddp->clk = devm_clk_get(dev, NULL); > - if (IS_ERR(ddp->clk)) { > - dev_err(dev, "Failed to get clock\n"); > - return PTR_ERR(ddp->clk); > + if (of_find_property(dev->of_node, "clocks", &i)) { > + ddp->clk = devm_clk_get(dev, NULL); > + if (IS_ERR(ddp->clk)) { > + dev_err(dev, "Failed to get clock\n"); > + return PTR_ERR(ddp->clk); > + } Only "mediatek,mt8133-disp-mutex" has no clock property. For other SoC, clock property is required. So I think this exception is just for mt8183. Regards, CK > } > > regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 110898] [Patch] to compile amdgpu-dkms 19.10 on debian stretch & buster
https://bugs.freedesktop.org/show_bug.cgi?id=110898 --- Comment #2 from Fab Stz --- Newer patch is for 19.20 (bug 03), I attached it to the wrong bug -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 111103] [Patch] to compile amdgpu-dkms 19.20 on debian stretch & buster
https://bugs.freedesktop.org/show_bug.cgi?id=03 --- Comment #1 from Fab Stz --- Created attachment 144809 --> https://bugs.freedesktop.org/attachment.cgi?id=144809&action=edit [Patch] to compile amdgpu-dkms 19.20 on debian stretch & buster (v2) Same patch as before but using #if to manage different kernel versions -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v18 11/15] IB/mlx4: untag user pointers in mlx4_get_umem_mr
On Tue, Jul 16, 2019 at 12:42:07PM +0200, Andrey Konovalov wrote: > On Mon, Jul 15, 2019 at 8:05 PM Jason Gunthorpe wrote: > > > > On Mon, Jul 15, 2019 at 06:01:29PM +0200, Andrey Konovalov wrote: > > > On Mon, Jun 24, 2019 at 7:40 PM Catalin Marinas > > > wrote: > > > > > > > > On Mon, Jun 24, 2019 at 04:32:56PM +0200, Andrey Konovalov wrote: > > > > > This patch is a part of a series that extends kernel ABI to allow to > > > > > pass > > > > > tagged user pointers (with the top byte set to something else other > > > > > than > > > > > 0x00) as syscall arguments. > > > > > > > > > > mlx4_get_umem_mr() uses provided user pointers for vma lookups, which > > > > > can > > > > > only by done with untagged pointers. > > > > > > > > > > Untag user pointers in this function. > > > > > > > > > > Signed-off-by: Andrey Konovalov > > > > > drivers/infiniband/hw/mlx4/mr.c | 7 --- > > > > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > > > > > Acked-by: Catalin Marinas > > > > > > > > This patch also needs an ack from the infiniband maintainers (Jason). > > > > > > Hi Jason, > > > > > > Could you take a look and give your acked-by? > > > > Oh, I think I did this a long time ago. Still looks OK. > > Hm, maybe that was we who lost it. Thanks! > > > You will send it? > > I will resend the patchset once the merge window is closed, if that's > what you mean. No.. I mean who send it to Linus's tree? ie do you want me to take this patch into rdma? Jason ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/amdgpu: fix double fetch in amdgpu_ras_debugfs_ctrl_parse_data()
In amdgpu_ras_debugfs_ctrl_parse_data(), first fetch str from buf to get op value, if op == -1 which means no command matched, fetch data from buf again. If change buf between two fetches may cause security problems or unexpected behaivor. amdgpu_ras_debugfs_ctrl_parse_data() was called by amdgpu_ras_debugfs_ctrl_write() and value of op was used later. We should check whether data->op == -1 or not after second fetch. if data->op != -1 means buf changed and should return -EINVAL. Signed-off-by: JingYi Hou --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index 22bd21efe6b1..845e73e98cd7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -233,6 +233,9 @@ static int amdgpu_ras_debugfs_ctrl_parse_data(struct file *f, if (copy_from_user(data, buf, sizeof(*data))) return -EINVAL; + + if(data->op != -1) + return -EINVAL; } return 0; -- 2.20.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH -next] drm/nouveau/secboot: Make acr_r352_ls_gpccs_func static
Fix sparse warning: drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c:1092:1: warning: symbol 'acr_r352_ls_gpccs_func' was not declared. Should it be static? Reported-by: Hulk Robot Signed-off-by: YueHaibing --- drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c index 4fd4cfe..7af971d 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/secboot/acr_r352.c @@ -1088,7 +1088,7 @@ acr_r352_ls_gpccs_func_0 = { .lhdr_flags = LSF_FLAG_FORCE_PRIV_LOAD, }; -const struct acr_r352_ls_func +static const struct acr_r352_ls_func acr_r352_ls_gpccs_func = { .load = acr_ls_ucode_load_gpccs, .version_max = 0, -- 2.7.4 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v18 11/15] IB/mlx4: untag user pointers in mlx4_get_umem_mr
On Mon, Jul 15, 2019 at 8:05 PM Jason Gunthorpe wrote: > > On Mon, Jul 15, 2019 at 06:01:29PM +0200, Andrey Konovalov wrote: > > On Mon, Jun 24, 2019 at 7:40 PM Catalin Marinas > > wrote: > > > > > > On Mon, Jun 24, 2019 at 04:32:56PM +0200, Andrey Konovalov wrote: > > > > This patch is a part of a series that extends kernel ABI to allow to > > > > pass > > > > tagged user pointers (with the top byte set to something else other than > > > > 0x00) as syscall arguments. > > > > > > > > mlx4_get_umem_mr() uses provided user pointers for vma lookups, which > > > > can > > > > only by done with untagged pointers. > > > > > > > > Untag user pointers in this function. > > > > > > > > Signed-off-by: Andrey Konovalov > > > > drivers/infiniband/hw/mlx4/mr.c | 7 --- > > > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > > > Acked-by: Catalin Marinas > > > > > > This patch also needs an ack from the infiniband maintainers (Jason). > > > > Hi Jason, > > > > Could you take a look and give your acked-by? > > Oh, I think I did this a long time ago. Still looks OK. Hm, maybe that was we who lost it. Thanks! > You will send it? I will resend the patchset once the merge window is closed, if that's what you mean. > > Reviewed-by: Jason Gunthorpe > > Jason ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 03/10] video: pxafb: Remove cpufreq policy notifier
The cpufreq policy notifier's CPUFREQ_ADJUST notification is going to get removed soon. The notifier callback pxafb_freq_policy() isn't doing anything apart from printing a debug message on CPUFREQ_ADJUST notification. There is no point in keeping an otherwise empty callback and registering the notifier. Remove it. Signed-off-by: Viresh Kumar --- drivers/video/fbdev/pxafb.c | 21 - drivers/video/fbdev/pxafb.h | 1 - 2 files changed, 22 deletions(-) diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index 4282cb117b92..f70c9f79622e 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -1678,24 +1678,6 @@ pxafb_freq_transition(struct notifier_block *nb, unsigned long val, void *data) } return 0; } - -static int -pxafb_freq_policy(struct notifier_block *nb, unsigned long val, void *data) -{ - struct pxafb_info *fbi = TO_INF(nb, freq_policy); - struct fb_var_screeninfo *var = &fbi->fb.var; - struct cpufreq_policy *policy = data; - - switch (val) { - case CPUFREQ_ADJUST: - pr_debug("min dma period: %d ps, " - "new clock %d kHz\n", pxafb_display_dma_period(var), - policy->max); - /* TODO: fill in min/max values */ - break; - } - return 0; -} #endif #ifdef CONFIG_PM @@ -2400,11 +2382,8 @@ static int pxafb_probe(struct platform_device *dev) #ifdef CONFIG_CPU_FREQ fbi->freq_transition.notifier_call = pxafb_freq_transition; - fbi->freq_policy.notifier_call = pxafb_freq_policy; cpufreq_register_notifier(&fbi->freq_transition, CPUFREQ_TRANSITION_NOTIFIER); - cpufreq_register_notifier(&fbi->freq_policy, - CPUFREQ_POLICY_NOTIFIER); #endif /* diff --git a/drivers/video/fbdev/pxafb.h b/drivers/video/fbdev/pxafb.h index b641289c8a99..86b1e9ab1a38 100644 --- a/drivers/video/fbdev/pxafb.h +++ b/drivers/video/fbdev/pxafb.h @@ -162,7 +162,6 @@ struct pxafb_info { #ifdef CONFIG_CPU_FREQ struct notifier_block freq_transition; - struct notifier_block freq_policy; #endif struct regulator *lcd_supply; -- 2.21.0.rc0.269.g1a574e7a288b ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
RE: [PATCH 2/2] drm/arm/malidp: Setting QoS priority for 4k to avoid flicker issue
> -Original Message- > From: liviu.du...@arm.com > Sent: 2019年3月30日 0:11 > To: Wen He > Cc: brian.star...@arm.com; mal...@foss.arm.com; > dri-devel@lists.freedesktop.org > Subject: Re: [PATCH 2/2] drm/arm/malidp: Setting QoS priority for 4k to avoid > flicker issue > > On Fri, Mar 29, 2019 at 08:20:00AM +, Wen He wrote: > > > > > > > -Original Message- > > > From: liviu.du...@arm.com [mailto:liviu.du...@arm.com] > > > Sent: 2019年3月29日 0:39 > > > To: Wen He > > > Cc: brian.star...@arm.com; mal...@foss.arm.com; > > > dri-devel@lists.freedesktop.org > > > Subject: Re: [PATCH 2/2] drm/arm/malidp: Setting QoS priority for 4k > > > to avoid flicker issue > > > > > > Hi Wen, > > > > > > On Thu, Mar 28, 2019 at 03:56:58AM +, Wen He wrote: > > > > When we running DDR benchmark test will able to observed flicker > > > > issue in 4k@60 resolution on monitor. In LS1028A SoC, need > > > > increasing DP500 priority to avoid that issue. > > > > > > > > Signed-off-by: Wen He > > > > --- > > > > drivers/gpu/drm/arm/malidp_hw.c | 13 + > > > > drivers/gpu/drm/arm/malidp_regs.h | 8 > > > > 2 files changed, 21 insertions(+) > > > > > > > > diff --git a/drivers/gpu/drm/arm/malidp_hw.c > > > > b/drivers/gpu/drm/arm/malidp_hw.c index > 8df12e9a33bb..a5263488eb02 > > > > 100644 > > > > --- a/drivers/gpu/drm/arm/malidp_hw.c > > > > +++ b/drivers/gpu/drm/arm/malidp_hw.c > > > > @@ -378,6 +378,19 @@ static void malidp500_modeset(struct > > > malidp_hw_device *hwdev, struct videomode * > > > > malidp_hw_setbits(hwdev, MALIDP_DISP_FUNC_ILACED, > > > MALIDP_DE_DISPLAY_FUNC); > > > > else > > > > malidp_hw_clearbits(hwdev, MALIDP_DISP_FUNC_ILACED, > > > > MALIDP_DE_DISPLAY_FUNC); > > > > + > > > > +#ifdef CONFIG_ARCH_LAYERSCAPE > > > > + /* Setting QoS for 4k resolution to avoid flicker issue */ > > > > + if (mode->hactive == 3840 > > > > + && mode->vactive == 2160) > > > > > > I'm not keen on this check, it only enables this for one 3840x2160. > > > What if the output is 2160x3840? Does it matter what pixel clock you use? > > > Can the same issue be seen if (for example) you use 120Hz refresh > > > rate but on a smaller output resolution? > > > > > > > Hi liviu, > > Hi Wen, > > > > > Let me clearly it. > > Currently, we only supported four resolutions (480p@60, 720p@60, > 1080@60, 4k@60) for LS1028A Display port. > > All of the refresh rate is 60MHz. so that impossible will be there > > resolution > output's 2160x3840 and refresh rate is 120MHz. > > Yes, but you are asking to merge this into the mainline driver which supports > more resolutions than that. > > > > > > I think it's worth thinking this in terms of bandwidth and not > > > hardcode for one resolution. > > > > > > > Yes, you are right. > > But only 4k resolution have the flicker issue, so this is a special problem. > > I think that hardcode is better than dynamically adjusting bandwidth. > > If you want to do that for your BSP, then it's fine. For mainline, I think we > can > do better and think in more generic terms. > > > > > > Also, I think setting the QoS bits should be a bit more generic, i.e > > > if the modeset requires a certain bandwidth you should write a value > > > read from a device tree, for example? > > > > > > > + malidp_hw_setbits(hwdev, GREEN_ARQOS_CONFIG > > > > + | RED_ARQOS_CONFIG, > > > > MALIDP500_RQOS_QUALITY); > > > > + else > > > > + malidp_hw_clearbits(hwdev, GREEN_ARQOS_CONFIG > > > > + | RED_ARQOS_CONFIG, > > > > MALIDP500_RQOS_QUALITY); > > > > + > > > > + malidp_hw_setbits(hwdev, CONFIG_VALID, > MALIDP500_CONFIG_VALID); > > > > > > malidp500_modeset() will be called with MALIDP_CFG_VALID set anyway, > > > so you should not need this. I don't know what bit 1 in > > > MALIDP500_CONFIG_VALID does for LS1028A, I don't have that spec. > > > > > > > About this, I got this step from our design team, So just to make sure > > the configuration works that writing value 0x3 to > MALIDP500_CONFIG_VALID. > > Bit 1 in MALIDP500_CONFIG_VALID is not defined in the Arm spec, so don't > know what the NXP design team has done there, might be worth talking to > them. > > > > > Is there can always to valid configuration? If yes, I can remove this line. > > Yes, before we enter modeset we set bit 0 of MALIDP500_CONFIG_VALID and > we clear it after modeset is finished. DP500 is a bit weird, you need to look > at > CONFIG_VALID as somewhat inverted as a signal from the software point of > view. > It is probably easier to think of it in the way the code was written, i.e. we > "enter config mode" before modeset and then "exit config mode" > afterwards. Hi Liviu, This patch is not a rigorous implementation for the mainline, I will use the new Implementation to send next version of the patch. Thanks for these comments. Best Re
Re: [PATCH v3 2/5] drm: bridge: dw-hdmi: Report connector status using callback
On Fri, Jul 12, 2019 at 6:48 PM Russell King - ARM Linux admin wrote: > > On Fri, Jul 12, 2019 at 06:04:40PM +0800, Cheng-Yi Chiang wrote: > > Allow codec driver register callback function for plug event. > > > > The callback registration flow: > > dw-hdmi <--- hw-hdmi-i2s-audio <--- hdmi-codec > > > > dw-hdmi-i2s-audio implements hook_plugged_cb op > > so codec driver can register the callback. > > > > dw-hdmi implements set_plugged_cb op so platform device can register the > > callback. > > > > When connector plug/unplug event happens, report this event using the > > callback. > > > > Make sure that audio and drm are using the single source of truth for > > connector status. > > > > Signed-off-by: Cheng-Yi Chiang > > --- > > .../gpu/drm/bridge/synopsys/dw-hdmi-audio.h | 3 + > > .../drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 10 > > drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 55 ++- > > 3 files changed, 67 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-audio.h > > b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-audio.h > > index 63b5756f463b..f523c590984e 100644 > > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-audio.h > > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-audio.h > > @@ -2,6 +2,8 @@ > > #ifndef DW_HDMI_AUDIO_H > > #define DW_HDMI_AUDIO_H > > > > +#include > > + > > struct dw_hdmi; > > > > struct dw_hdmi_audio_data { > > @@ -17,6 +19,7 @@ struct dw_hdmi_i2s_audio_data { > > > > void (*write)(struct dw_hdmi *hdmi, u8 val, int offset); > > u8 (*read)(struct dw_hdmi *hdmi, int offset); > > + int (*set_plugged_cb)(struct dw_hdmi *hdmi, hdmi_codec_plugged_cb fn); > > }; > > > > #endif > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c > > b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c > > index 5cbb71a866d5..7b93cf05c985 100644 > > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c > > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c > > @@ -104,10 +104,20 @@ static int dw_hdmi_i2s_get_dai_id(struct > > snd_soc_component *component, > > return -EINVAL; > > } > > > > +static int dw_hdmi_i2s_hook_plugged_cb(struct device *dev, void *data, > > +hdmi_codec_plugged_cb fn) > > +{ > > + struct dw_hdmi_i2s_audio_data *audio = data; > > + struct dw_hdmi *hdmi = audio->hdmi; > > + > > + return audio->set_plugged_cb(hdmi, fn); > > +} > > + > > static struct hdmi_codec_ops dw_hdmi_i2s_ops = { > > .hw_params = dw_hdmi_i2s_hw_params, > > .audio_shutdown = dw_hdmi_i2s_audio_shutdown, > > .get_dai_id = dw_hdmi_i2s_get_dai_id, > > + .hook_plugged_cb = dw_hdmi_i2s_hook_plugged_cb, > > }; > > > > static int snd_dw_hdmi_probe(struct platform_device *pdev) > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > index 045b1b13fd0e..ce6646067472 100644 > > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c > > @@ -26,6 +26,8 @@ > > #include > > #include > > > > +#include > > + > > #include > > #include > > > > @@ -185,6 +187,9 @@ struct dw_hdmi { > > void (*disable_audio)(struct dw_hdmi *hdmi); > > > > struct cec_notifier *cec_notifier; > > + > > + hdmi_codec_plugged_cb plugged_cb; > > + enum drm_connector_status last_connector_result; > > }; > > > > #define HDMI_IH_PHY_STAT0_RX_SENSE \ > > @@ -209,6 +214,40 @@ static inline u8 hdmi_readb(struct dw_hdmi *hdmi, int > > offset) > > return val; > > } > > > > +static void handle_plugged_change(struct dw_hdmi *hdmi, bool plugged) > > +{ > > + struct platform_device *codec_pdev; > > + > > + if (!hdmi->audio || IS_ERR(hdmi->audio)) > > + return; > > + codec_pdev = platform_get_drvdata(hdmi->audio); > > + if (!codec_pdev || IS_ERR(codec_pdev)) > > + return; > > This looks fragile to me, poking about in another device's driver data > from another driver is really not a good design decision. I think this > can be simplified if the registration function took the function > pointer and the struct device pointer, and then you only need one test > below: > Hi Russell, Thank you for the detailed review. ACK to this suggestion. I have updated the registration function following your suggestion in v4. It looks much cleaner. > > + if (!hdmi->plugged_cb) > > + return; > > + > > + hdmi->plugged_cb(&codec_pdev->dev, plugged); > > +} > > + > > +static int hdmi_set_plugged_cb(struct dw_hdmi *hdmi, hdmi_codec_plugged_cb > > fn) > > +{ > > + bool plugged; > > + struct platform_device *codec_pdev; > > + > > + if (!hdmi->audio || IS_ERR(hdmi->audio)) > > + return -EINVAL; > > Given the current code structure, how can this ever be true when the > function is called? > ACK Removed in v4. > > + codec_pdev = platform_get_drvdata(hdmi->audio); > > +
[Bug 105733] Amdgpu randomly hangs and only ssh works. Mouse cursor moves sometimes but does nothing. Keyboard stops working.
https://bugs.freedesktop.org/show_bug.cgi?id=105733 Michel Dänzer changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |WORKSFORME --- Comment #82 from Michel Dänzer --- (In reply to Hadet from comment #81) > Having some similar issues. After closing games running in Wine specifically Please file your own report. The reporter of this one marked it as resolved. -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v4 4/5] ASoC: rockchip_max98090: Add dai_link for HDMI
On Tue, Jul 16, 2019 at 10:14 PM Tzung-Bi Shih wrote: > > On Tue, Jul 16, 2019 at 7:58 PM Cheng-Yi Chiang wrote: > > > > diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig > > index b43657e6e655..d610b553ea3b 100644 > > --- a/sound/soc/rockchip/Kconfig > > +++ b/sound/soc/rockchip/Kconfig > > @@ -40,9 +40,10 @@ config SND_SOC_ROCKCHIP_MAX98090 > > select SND_SOC_ROCKCHIP_I2S > > select SND_SOC_MAX98090 > > select SND_SOC_TS3A227E > > + select SND_SOC_HDMI_CODEC > > help > > Say Y or M here if you want to add support for SoC audio on > > Rockchip > > - boards using the MAX98090 codec, such as Veyron. > > + boards using the MAX98090 codec and HDMI codec, such as Veyron. > You should not need to select the option in this patch (but in next > patch), because this patch does not depend on anything from > hdmi-codec.c. Thanks for the explanation. I'll fix in v5.
Re: [PATCH v4 5/5] ASoC: rockchip_max98090: Add HDMI jack support
On Tue, Jul 16, 2019 at 10:16 PM Tzung-Bi Shih wrote: > > On Tue, Jul 16, 2019 at 7:58 PM Cheng-Yi Chiang wrote: > > > > diff --git a/sound/soc/rockchip/rockchip_max98090.c > > b/sound/soc/rockchip/rockchip_max98090.c > > index c82948e383da..c81c4acda917 100644 > > --- a/sound/soc/rockchip/rockchip_max98090.c > > +++ b/sound/soc/rockchip/rockchip_max98090.c > > +static struct snd_soc_jack rk_hdmi_jack; > > + > > +static int rk_hdmi_init(struct snd_soc_pcm_runtime *runtime) > > +{ > > + struct snd_soc_card *card = runtime->card; > > + struct snd_soc_component *component = runtime->codec_dai->component; > > + int ret; > > + > > + /* enable jack detection */ > > + ret = snd_soc_card_jack_new(card, "HDMI Jack", SND_JACK_LINEOUT, > > + &rk_hdmi_jack, NULL, 0); > > + if (ret) { > > + dev_err(card->dev, "Can't new HDMI Jack %d\n", ret); > > + return ret; > > + } > > + > > + return hdmi_codec_set_jack_detect(component, &rk_hdmi_jack); > > +} > In the patch, you should select SND_SOC_HDMI_CODEC, because the patch > uses hdmi_codec_set_jack_detect which depends on hdmi-codec.c. Thanks! I'll fix in v5.
Re: [PATCH 2/3] drm: introduce DRIVER_FORCE_AUTH
Hi Emil, Sorry for the delay, finally coming back to this after my vacation. Am 03.07.19 um 17:14 schrieb Emil Velikov: > On Wed, 3 Jul 2019 at 15:58, Koenig, Christian > wrote: >> Am 03.07.2019 16:51 schrieb Emil Velikov : >> >> On Wed, 3 Jul 2019 at 15:33, Koenig, Christian >> wrote: >>> Am 03.07.2019 16:00 schrieb Emil Velikov : >>> >>> On Wed, 3 Jul 2019 at 14:48, Koenig, Christian >>> wrote: Well this is still a NAK. As stated previously please just don't remove DRM_AUTH and keep the functionality as it is. >>> AFAICT nobody was in favour of your suggestion to remove DRM_AUTH from >>> the handle to/from fd ioclts. >>> Thus this seems like the second best option. >>> >>> >>> Well just keep it. As I said please don't change anything here. >>> >>> Dropping DRM_AUTH from the driver IOCTLs was sufficient to work around the >>> problems at hand far as I know. >>> >> We also need the DRM_AUTH for handle to/from fd ones. Mesa drivers use >> those ioctls. >> >> >> Yeah, but only for importing/exporting things. >> >> And in those cases we either already gave render nodes or correctly >> authenticated primary nodes. >> >> So no need to change anything here as far as I see. >> > Not quite. When working with the primary node we have the following scenarios: > - handle to fd -> pass fd to other APIs - gbm, opencl, vdpau, etc > - handle to fd -> fd to handle - use it internally Yeah, but this would once more mean that we expose the same functionality on the primary node we do on the render node. And that is exactly what I want to prevent, because I think it is a very bad idea and will result in basically deprecating the render node. For the problem at hand it was sufficient to drop the DRM_AUTH flag from the driver IOCTLs and I don't see a reason why we should go further than this. Please just completely drop this whole approach, Christian. > > -Emil ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 1/5] ASoC: hdmi-codec: Add an op to set callback function for plug event
Add an op in hdmi_codec_ops so codec driver can register callback function to handle plug event. Driver in DRM can use this callback function to report connector status. Signed-off-by: Cheng-Yi Chiang --- include/sound/hdmi-codec.h| 17 + sound/soc/codecs/hdmi-codec.c | 46 +++ 2 files changed, 63 insertions(+) diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h index 7fea496f1f34..83b17682e01c 100644 --- a/include/sound/hdmi-codec.h +++ b/include/sound/hdmi-codec.h @@ -47,6 +47,9 @@ struct hdmi_codec_params { int channels; }; +typedef void (*hdmi_codec_plugged_cb)(struct device *dev, + bool plugged); + struct hdmi_codec_pdata; struct hdmi_codec_ops { /* @@ -88,6 +91,14 @@ struct hdmi_codec_ops { */ int (*get_dai_id)(struct snd_soc_component *comment, struct device_node *endpoint); + + /* +* Hook callback function to handle connector plug event. +* Optional +*/ + int (*hook_plugged_cb)(struct device *dev, void *data, + hdmi_codec_plugged_cb fn, + struct device *codec_dev); }; /* HDMI codec initalization data */ @@ -99,6 +110,12 @@ struct hdmi_codec_pdata { void *data; }; +struct snd_soc_component; +struct snd_soc_jack; + +int hdmi_codec_set_jack_detect(struct snd_soc_component *component, + struct snd_soc_jack *jack); + #define HDMI_CODEC_DRV_NAME "hdmi-audio-codec" #endif /* __HDMI_CODEC_H__ */ diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 0bf1c8cad108..b5fd8f08726e 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -274,6 +275,8 @@ struct hdmi_codec_priv { struct snd_pcm_chmap *chmap_info; unsigned int chmap_idx; struct mutex lock; + struct snd_soc_jack *jack; + unsigned int jack_status; }; static const struct snd_soc_dapm_widget hdmi_widgets[] = { @@ -663,6 +666,49 @@ static int hdmi_dai_probe(struct snd_soc_dai *dai) return 0; } +static void hdmi_codec_jack_report(struct hdmi_codec_priv *hcp, + unsigned int jack_status) +{ + if (hcp->jack && jack_status != hcp->jack_status) { + snd_soc_jack_report(hcp->jack, jack_status, SND_JACK_LINEOUT); + hcp->jack_status = jack_status; + } +} + +static void plugged_cb(struct device *dev, bool plugged) +{ + struct hdmi_codec_priv *hcp = dev_get_drvdata(dev); + + if (plugged) + hdmi_codec_jack_report(hcp, SND_JACK_LINEOUT); + else + hdmi_codec_jack_report(hcp, 0); +} + +/** + * hdmi_codec_set_jack_detect - register HDMI plugged callback + * @component: the hdmi-codec instance + * @jack: ASoC jack to report (dis)connection events on + */ +int hdmi_codec_set_jack_detect(struct snd_soc_component *component, + struct snd_soc_jack *jack) +{ + struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); + int ret = -EOPNOTSUPP; + + if (hcp->hcd.ops->hook_plugged_cb) { + hcp->jack = jack; + ret = hcp->hcd.ops->hook_plugged_cb(component->dev->parent, + hcp->hcd.data, + plugged_cb, + component->dev); + if (ret) + hcp->jack = NULL; + } + return ret; +} +EXPORT_SYMBOL_GPL(hdmi_codec_set_jack_detect); + static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai) { struct hdmi_codec_daifmt *cf = dai->playback_dma_data; -- 2.22.0.510.g264f2c817a-goog
[PATCH v5 0/5] Add HDMI jack support on RK3288
This patch series supports HDMI jack reporting on RK3288, which uses DRM dw-hdmi driver and hdmi-codec codec driver. The previous discussion about reporting jack status using hdmi-notifier and drm_audio_component is at https://lore.kernel.org/patchwork/patch/1083027/ The new approach is to use a callback mechanism that is specific to hdmi-codec. Changes from v4 to v5: - synopsys/Kconfig: Remove the incorrect dependency change in v4. - rockchip/Kconfig: Add dependency of hdmi-codec when it is really need for jack support. Cheng-Yi Chiang (5): ASoC: hdmi-codec: Add an op to set callback function for plug event drm: bridge: dw-hdmi: Report connector status using callback drm: dw-hdmi-i2s: Use fixed id for codec device ASoC: rockchip_max98090: Add dai_link for HDMI ASoC: rockchip_max98090: Add HDMI jack support .../drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 13 +- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 41 ++- include/drm/bridge/dw_hdmi.h | 4 + include/sound/hdmi-codec.h| 17 +++ sound/soc/codecs/hdmi-codec.c | 46 +++ sound/soc/rockchip/Kconfig| 3 +- sound/soc/rockchip/rk3288_hdmi_analog.c | 3 +- sound/soc/rockchip/rockchip_max98090.c| 116 ++ 8 files changed, 216 insertions(+), 27 deletions(-) -- 2.22.0.510.g264f2c817a-goog
[PATCH v5 2/5] drm: bridge: dw-hdmi: Report connector status using callback
Allow codec driver register callback function for plug event. The callback registration flow: dw-hdmi <--- hw-hdmi-i2s-audio <--- hdmi-codec dw-hdmi-i2s-audio implements hook_plugged_cb op so codec driver can register the callback. dw-hdmi exports a function dw_hdmi_set_plugged_cb so platform device can register the callback. When connector plug/unplug event happens, report this event using the callback. Make sure that audio and drm are using the single source of truth for connector status. Signed-off-by: Cheng-Yi Chiang --- .../drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 11 + drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 41 ++- include/drm/bridge/dw_hdmi.h | 4 ++ 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c index 5cbb71a866d5..ca56783fae47 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c @@ -104,10 +104,21 @@ static int dw_hdmi_i2s_get_dai_id(struct snd_soc_component *component, return -EINVAL; } +static int dw_hdmi_i2s_hook_plugged_cb(struct device *dev, void *data, + hdmi_codec_plugged_cb fn, + struct device *codec_dev) +{ + struct dw_hdmi_i2s_audio_data *audio = data; + struct dw_hdmi *hdmi = audio->hdmi; + + return dw_hdmi_set_plugged_cb(hdmi, fn, codec_dev); +} + static struct hdmi_codec_ops dw_hdmi_i2s_ops = { .hw_params = dw_hdmi_i2s_hw_params, .audio_shutdown = dw_hdmi_i2s_audio_shutdown, .get_dai_id = dw_hdmi_i2s_get_dai_id, + .hook_plugged_cb = dw_hdmi_i2s_hook_plugged_cb, }; static int snd_dw_hdmi_probe(struct platform_device *pdev) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 045b1b13fd0e..f32c66a6873d 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -185,6 +185,10 @@ struct dw_hdmi { void (*disable_audio)(struct dw_hdmi *hdmi); struct cec_notifier *cec_notifier; + + hdmi_codec_plugged_cb plugged_cb; + struct device *codec_dev; + enum drm_connector_status last_connector_result; }; #define HDMI_IH_PHY_STAT0_RX_SENSE \ @@ -209,6 +213,28 @@ static inline u8 hdmi_readb(struct dw_hdmi *hdmi, int offset) return val; } +static void handle_plugged_change(struct dw_hdmi *hdmi, bool plugged) +{ + if (hdmi->plugged_cb && hdmi->codec_dev) + hdmi->plugged_cb(hdmi->codec_dev, plugged); +} + +int dw_hdmi_set_plugged_cb(struct dw_hdmi *hdmi, hdmi_codec_plugged_cb fn, + struct device *codec_dev) +{ + bool plugged; + + mutex_lock(&hdmi->mutex); + hdmi->plugged_cb = fn; + hdmi->codec_dev = codec_dev; + plugged = hdmi->last_connector_result == connector_status_connected; + handle_plugged_change(hdmi, plugged); + mutex_unlock(&hdmi->mutex); + + return 0; +} +EXPORT_SYMBOL_GPL(dw_hdmi_set_plugged_cb); + static void hdmi_modb(struct dw_hdmi *hdmi, u8 data, u8 mask, unsigned reg) { regmap_update_bits(hdmi->regm, reg << hdmi->reg_shift, mask, data); @@ -2044,6 +2070,7 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force) { struct dw_hdmi *hdmi = container_of(connector, struct dw_hdmi, connector); + enum drm_connector_status result; mutex_lock(&hdmi->mutex); hdmi->force = DRM_FORCE_UNSPECIFIED; @@ -2051,7 +2078,18 @@ dw_hdmi_connector_detect(struct drm_connector *connector, bool force) dw_hdmi_update_phy_mask(hdmi); mutex_unlock(&hdmi->mutex); - return hdmi->phy.ops->read_hpd(hdmi, hdmi->phy.data); + result = hdmi->phy.ops->read_hpd(hdmi, hdmi->phy.data); + + mutex_lock(&hdmi->mutex); + if (result != hdmi->last_connector_result) { + dev_dbg(hdmi->dev, "read_hpd result: %d", result); + handle_plugged_change(hdmi, + result == connector_status_connected); + hdmi->last_connector_result = result; + } + mutex_unlock(&hdmi->mutex); + + return result; } static int dw_hdmi_connector_get_modes(struct drm_connector *connector) @@ -2460,6 +2498,7 @@ __dw_hdmi_probe(struct platform_device *pdev, hdmi->rxsense = true; hdmi->phy_mask = (u8)~(HDMI_PHY_HPD | HDMI_PHY_RX_SENSE); hdmi->mc_clkdis = 0x7f; + hdmi->last_connector_result = connector_status_disconnected; mutex_init(&hdmi->mutex); mutex_init(&hdmi->audio_mutex); diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index b4ca970a5b75..d6c925236c55 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_h
[PATCH v5 5/5] ASoC: rockchip_max98090: Add HDMI jack support
In machine driver, create a jack and let hdmi-codec report jack status. Signed-off-by: Cheng-Yi Chiang --- sound/soc/rockchip/Kconfig | 3 ++- sound/soc/rockchip/rockchip_max98090.c | 20 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig index b43657e6e655..d610b553ea3b 100644 --- a/sound/soc/rockchip/Kconfig +++ b/sound/soc/rockchip/Kconfig @@ -40,9 +40,10 @@ config SND_SOC_ROCKCHIP_MAX98090 select SND_SOC_ROCKCHIP_I2S select SND_SOC_MAX98090 select SND_SOC_TS3A227E + select SND_SOC_HDMI_CODEC help Say Y or M here if you want to add support for SoC audio on Rockchip - boards using the MAX98090 codec, such as Veyron. + boards using the MAX98090 codec and HDMI codec, such as Veyron. config SND_SOC_ROCKCHIP_RT5645 tristate "ASoC support for Rockchip boards using a RT5645/RT5650 codec" diff --git a/sound/soc/rockchip/rockchip_max98090.c b/sound/soc/rockchip/rockchip_max98090.c index c82948e383da..c81c4acda917 100644 --- a/sound/soc/rockchip/rockchip_max98090.c +++ b/sound/soc/rockchip/rockchip_max98090.c @@ -134,6 +134,25 @@ enum { DAILINK_HDMI, }; +static struct snd_soc_jack rk_hdmi_jack; + +static int rk_hdmi_init(struct snd_soc_pcm_runtime *runtime) +{ + struct snd_soc_card *card = runtime->card; + struct snd_soc_component *component = runtime->codec_dai->component; + int ret; + + /* enable jack detection */ + ret = snd_soc_card_jack_new(card, "HDMI Jack", SND_JACK_LINEOUT, + &rk_hdmi_jack, NULL, 0); + if (ret) { + dev_err(card->dev, "Can't new HDMI Jack %d\n", ret); + return ret; + } + + return hdmi_codec_set_jack_detect(component, &rk_hdmi_jack); +} + /* max98090 and HDMI codec dai_link */ static struct snd_soc_dai_link rk_dailinks[] = { [DAILINK_MAX98090] = { @@ -151,6 +170,7 @@ static struct snd_soc_dai_link rk_dailinks[] = { .ops = &rk_aif1_ops, .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, + .init = rk_hdmi_init, SND_SOC_DAILINK_REG(hdmi), } }; -- 2.22.0.510.g264f2c817a-goog
[PATCH v5 3/5] drm: dw-hdmi-i2s: Use fixed id for codec device
The problem of using auto ID is that the device name will be like hdmi-audio-codec..auto. The number might be changed when there are other platform devices being created before hdmi-audio-codec device. Use a fixed name so machine driver can set codec name on the DAI link. Using the fixed name should be fine because there will only be one hdmi-audio-codec device. Fix the codec name in rockchip rk3288_hdmi_analog machine driver. Signed-off-by: Cheng-Yi Chiang --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 2 +- sound/soc/rockchip/rk3288_hdmi_analog.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c index ca56783fae47..bc608f9258be 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c @@ -135,7 +135,7 @@ static int snd_dw_hdmi_probe(struct platform_device *pdev) memset(&pdevinfo, 0, sizeof(pdevinfo)); pdevinfo.parent = pdev->dev.parent; - pdevinfo.id = PLATFORM_DEVID_AUTO; + pdevinfo.id = PLATFORM_DEVID_NONE; pdevinfo.name = HDMI_CODEC_DRV_NAME; pdevinfo.data = &pdata; pdevinfo.size_data = sizeof(pdata); diff --git a/sound/soc/rockchip/rk3288_hdmi_analog.c b/sound/soc/rockchip/rk3288_hdmi_analog.c index 767700c34ee2..8286025a8747 100644 --- a/sound/soc/rockchip/rk3288_hdmi_analog.c +++ b/sound/soc/rockchip/rk3288_hdmi_analog.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -142,7 +143,7 @@ static const struct snd_soc_ops rk_ops = { SND_SOC_DAILINK_DEFS(audio, DAILINK_COMP_ARRAY(COMP_EMPTY()), DAILINK_COMP_ARRAY(COMP_CODEC(NULL, NULL), - COMP_CODEC("hdmi-audio-codec.2.auto", "i2s-hifi")), + COMP_CODEC(HDMI_CODEC_DRV_NAME, "i2s-hifi")), DAILINK_COMP_ARRAY(COMP_EMPTY())); static struct snd_soc_dai_link rk_dailink = { -- 2.22.0.510.g264f2c817a-goog
[PATCH v5 4/5] ASoC: rockchip_max98090: Add dai_link for HDMI
Use two dai_links. One for HDMI and one for max98090. With this setup, audio can play to speaker and HDMI selectively. Signed-off-by: Cheng-Yi Chiang --- sound/soc/rockchip/rockchip_max98090.c | 96 -- 1 file changed, 73 insertions(+), 23 deletions(-) diff --git a/sound/soc/rockchip/rockchip_max98090.c b/sound/soc/rockchip/rockchip_max98090.c index c5fc24675a33..c82948e383da 100644 --- a/sound/soc/rockchip/rockchip_max98090.c +++ b/sound/soc/rockchip/rockchip_max98090.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -41,6 +42,7 @@ static const struct snd_soc_dapm_widget rk_dapm_widgets[] = { SND_SOC_DAPM_MIC("Headset Mic", NULL), SND_SOC_DAPM_MIC("Int Mic", NULL), SND_SOC_DAPM_SPK("Speaker", NULL), + SND_SOC_DAPM_LINE("HDMI", NULL), }; static const struct snd_soc_dapm_route rk_audio_map[] = { @@ -52,6 +54,7 @@ static const struct snd_soc_dapm_route rk_audio_map[] = { {"Headphone", NULL, "HPR"}, {"Speaker", NULL, "SPKL"}, {"Speaker", NULL, "SPKR"}, + {"HDMI", NULL, "TX"}, }; static const struct snd_kcontrol_new rk_mc_controls[] = { @@ -59,6 +62,7 @@ static const struct snd_kcontrol_new rk_mc_controls[] = { SOC_DAPM_PIN_SWITCH("Headset Mic"), SOC_DAPM_PIN_SWITCH("Int Mic"), SOC_DAPM_PIN_SWITCH("Speaker"), + SOC_DAPM_PIN_SWITCH("HDMI"), }; static int rk_aif1_hw_params(struct snd_pcm_substream *substream, @@ -92,38 +96,63 @@ static int rk_aif1_hw_params(struct snd_pcm_substream *substream, ret = snd_soc_dai_set_sysclk(cpu_dai, 0, mclk, SND_SOC_CLOCK_OUT); - if (ret < 0) { - dev_err(codec_dai->dev, "Can't set codec clock %d\n", ret); + if (ret) { + dev_err(cpu_dai->dev, "Can't set cpu dai clock %d\n", ret); return ret; } + /* HDMI codec dai does not need to set sysclk. */ + if (!strcmp(rtd->dai_link->name, "HDMI")) + return 0; + ret = snd_soc_dai_set_sysclk(codec_dai, 0, mclk, SND_SOC_CLOCK_IN); - if (ret < 0) { - dev_err(codec_dai->dev, "Can't set codec clock %d\n", ret); + if (ret) { + dev_err(codec_dai->dev, "Can't set codec dai clock %d\n", ret); return ret; } - return ret; + return 0; } static const struct snd_soc_ops rk_aif1_ops = { .hw_params = rk_aif1_hw_params, }; -SND_SOC_DAILINK_DEFS(hifi, +SND_SOC_DAILINK_DEFS(analog, DAILINK_COMP_ARRAY(COMP_EMPTY()), DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "HiFi")), DAILINK_COMP_ARRAY(COMP_EMPTY())); -static struct snd_soc_dai_link rk_dailink = { - .name = "max98090", - .stream_name = "Audio", - .ops = &rk_aif1_ops, - /* set max98090 as slave */ - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | - SND_SOC_DAIFMT_CBS_CFS, - SND_SOC_DAILINK_REG(hifi), +SND_SOC_DAILINK_DEFS(hdmi, + DAILINK_COMP_ARRAY(COMP_EMPTY()), + DAILINK_COMP_ARRAY(COMP_CODEC(HDMI_CODEC_DRV_NAME, "i2s-hifi")), + DAILINK_COMP_ARRAY(COMP_EMPTY())); + +enum { + DAILINK_MAX98090, + DAILINK_HDMI, +}; + +/* max98090 and HDMI codec dai_link */ +static struct snd_soc_dai_link rk_dailinks[] = { + [DAILINK_MAX98090] = { + .name = "max98090", + .stream_name = "Analog", + .ops = &rk_aif1_ops, + /* set max98090 as slave */ + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS, + SND_SOC_DAILINK_REG(analog), + }, + [DAILINK_HDMI] = { + .name = "HDMI", + .stream_name = "HDMI", + .ops = &rk_aif1_ops, + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS, + SND_SOC_DAILINK_REG(hdmi), + } }; static int rk_98090_headset_init(struct snd_soc_component *component); @@ -136,8 +165,8 @@ static struct snd_soc_aux_dev rk_98090_headset_dev = { static struct snd_soc_card snd_soc_card_rk = { .name = "ROCKCHIP-I2S", .owner = THIS_MODULE, - .dai_link = &rk_dailink, - .num_links = 1, + .dai_link = rk_dailinks, + .num_links = ARRAY_SIZE(rk_dailinks), .aux_dev = &rk_98090_headset_dev, .num_aux_devs = 1, .dapm_widgets = rk_dapm_widgets, @@ -173,27 +202,48 @@ static int snd_rk_mc_probe(struct platform_device *pdev) int ret = 0; struct snd_soc_card *card = &snd_soc_card_rk; struct device_node *np = pdev->dev.of_node; + struct device_node *np_analog; + struct device_node *np_cpu; + struct of_phandle_args args; /* register the soc card */ card->dev = &pdev->dev; - rk_dail
[PATCH] drm/arm/mali-dp: Add display QoS interface configuration
Configure the display Quality of service (QoS) levels to high priority if the level is defined as high as in DTS. The ARQOS for DP500 is driven from the "RQOS" register, needed to program the RQOS register value < 7 for the 4k resolution flicker to disappear on the LS1028A platform. Signed-off-by: Wen He --- change in v2: - add new implementation for 4k flicker issue on the LS1028A drivers/gpu/drm/arm/malidp_drv.c | 5 + drivers/gpu/drm/arm/malidp_hw.c | 13 + drivers/gpu/drm/arm/malidp_hw.h | 3 +++ drivers/gpu/drm/arm/malidp_regs.h | 12 4 files changed, 33 insertions(+) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index f25ec4382277..d2b2cf52ac87 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -818,6 +818,11 @@ static int malidp_bind(struct device *dev) malidp->core_id = version; + hwdev->arqos_high_level = false; + + hwdev->arqos_high_level = of_property_read_bool(dev->of_node, + "arm,malidp-arqos-high-level"); + /* set the number of lines used for output of RGB data */ ret = of_property_read_u8_array(dev->of_node, "arm,malidp-output-port-lines", diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c index 50af399d7f6f..eaa1658cd86b 100644 --- a/drivers/gpu/drm/arm/malidp_hw.c +++ b/drivers/gpu/drm/arm/malidp_hw.c @@ -374,6 +374,19 @@ static void malidp500_modeset(struct malidp_hw_device *hwdev, struct videomode * malidp_hw_setbits(hwdev, MALIDP_DISP_FUNC_ILACED, MALIDP_DE_DISPLAY_FUNC); else malidp_hw_clearbits(hwdev, MALIDP_DISP_FUNC_ILACED, MALIDP_DE_DISPLAY_FUNC); + + /* +* Program the RQoS register to increasing QoS levels for +* the 4k resolution flicker to disappear on the LS1028A. +*/ + if (hwdev->arqos_high_level) { + val = RED_ARQOS_VALUE | GREEN_ARQOS_VALUE; + + if (mode->pixelclock == 59400) + malidp_hw_setbits(hwdev, val, MALIDP500_RQOS_QUALITY); + else + malidp_hw_clearbits(hwdev, val, MALIDP500_RQOS_QUALITY); + } } int malidp_format_get_bpp(u32 fmt) diff --git a/drivers/gpu/drm/arm/malidp_hw.h b/drivers/gpu/drm/arm/malidp_hw.h index 968a65eed371..b8baba60508a 100644 --- a/drivers/gpu/drm/arm/malidp_hw.h +++ b/drivers/gpu/drm/arm/malidp_hw.h @@ -251,6 +251,9 @@ struct malidp_hw_device { /* size of memory used for rotating layers, up to two banks available */ u32 rotation_memory[2]; + + /* priority level of RQOS register used for driven the ARQOS signal */ + bool arqos_high_level; }; static inline u32 malidp_hw_read(struct malidp_hw_device *hwdev, u32 reg) diff --git a/drivers/gpu/drm/arm/malidp_regs.h b/drivers/gpu/drm/arm/malidp_regs.h index 993031542fa1..08842142b3b2 100644 --- a/drivers/gpu/drm/arm/malidp_regs.h +++ b/drivers/gpu/drm/arm/malidp_regs.h @@ -210,6 +210,18 @@ #define MALIDP500_CONFIG_VALID 0x00f00 #define MALIDP500_CONFIG_ID0x00fd4 +/* + * The quality of service (QoS) register on the DP500. RQOS register values + * are driven by the ARQOS signal, using AXI transacations, dependent on the + * FIFO input level. + * The RQOS register can also set QoS levels for: + *- RED_ARQOS @ A 4-bit signal value for close to underflow conditions + *- GREEN_ARQOS @ A 4-bit signal value for normal conditions + */ +#define MALIDP500_RQOS_QUALITY 0x00500 +#define RED_ARQOS_VALUE (0xd << 12) +#define GREEN_ARQOS_VALUE (0xd << 28) + /* register offsets and bits specific to DP550/DP650 */ #define MALIDP550_ADDR_SPACE_SIZE 0x1 #define MALIDP550_DE_CONTROL 0x00010 -- 2.17.1
[Bug 204145] amdgpu video playback causes host to hard reset (checkstop) on POWER9 with RX 580
https://bugzilla.kernel.org/show_bug.cgi?id=204145 --- Comment #15 from Timothy Pearson (tpear...@raptorengineering.com) --- Bisect shows that the failing commit is: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.1.y&id=cc17d7802b7dcbb073e7be1eee2cf6fa64d9 This is on a WX7100 GPU, the lockup is 100% repeatable after that patch goes in. Unfortunately it does not cleanly reverse on the 5.1 kernel so I can't verify this is the only problem with 5.1, but it's a start. Any IBMers have ideas why this patch went in and why it would be causing "Cache line inhibited hit cacheable space" faults? -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v7 2/2] Input: add Apple SPI keyboard and trackpad driver.
Hi Dmitry, thanks for taking a look at this! On Tue, Jul 16, 2019 at 08:47:44PM +0200, Dmitry Torokhov wrote: > Hi Ronald, > > On Fri, Apr 19, 2019 at 01:19:26AM -0700, Ronald Tschalär wrote: > > The keyboard and trackpad on recent MacBook's (since 8,1) and > > MacBookPro's (13,* and 14,*) are attached to an SPI controller instead > > of USB, as previously. The higher level protocol is not publicly > > documented and hence has been reverse engineered. As a consequence there > > are still a number of unknown fields and commands. However, the known > > parts have been working well and received extensive testing and use. > > > > In order for this driver to work, the proper SPI drivers need to be > > loaded too; for MB8,1 these are spi_pxa2xx_platform and spi_pxa2xx_pci; > > for all others they are spi_pxa2xx_platform and intel_lpss_pci. For this > > reason enabling this driver in the config implies enabling the above > > drivers. > > I applied the patch (but changed __u8 to u8 as that's preferred form for > inside the kernel, and added error handling for input_mt_init_slots) but > we need to do some more work on the driver. Looks good. > My main issue is with registering touchpad device asynchronously, > independent from the probe() function. This means (as far as I can tell) > that any error is not really appropriately handled (as by that time it > is too late to signal errors from probe()) and devm functions are not > going to be called, leaving remnants of the resources in memory on > driver unload. It also brings in issues with suspend/resume (what > happens if you suspend really quickly while device is not registered > yet?), etc, etc. Yes, the lack of error propagation also bothered me a bit when I introduced the dev-info command, but I thought doing synchronous I/O operations in a probe function wasn't kosher. Happy to rectify that though. > Can we switch to calling DEV_INFO command synchronously from probe()? If > we are concerned about it taking relatively long time we can always > annotate the driver as having probe_type = PROBE_PREFER_ASYNCHRONOUS so > that other devices can be probed simultaneously with applespi. Normally the dev-info retrieval takes about 15ms - I presume that's fast enough? Attached is a patch that does this now (on top of your changes above). The cancelling of outstanding spi requests in the error case is a bit ugly (I wish there were an exported spi-flush/spi-wait-for-queue-empty function or similar), but otherwise it's fairly straightforward. Cheers, Ronald >From a03a7b42ac6ea0707165c8beba04c722984064be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ronald=20Tschal=C3=A4r?= Date: Wed, 17 Jul 2019 02:46:57 -0700 Subject: [PATCH] Input: applespi - register touchpad device synchronously in probe. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows errors during registration to properly fail the probe function. Doing this requires waiting for a response from the device inside the probe function. While this generally takes about 15ms, in case of errors it could be arbitrarily long, and hence a 3 second timeout is used. This also adds 3 second timeouts to the drain functions to avoid the potential for suspend or remove hanging forever. Signed-off-by: Ronald Tschalär --- drivers/input/keyboard/applespi.c | 125 -- 1 file changed, 100 insertions(+), 25 deletions(-) diff --git a/drivers/input/keyboard/applespi.c b/drivers/input/keyboard/applespi.c index 548737e7aeda..81a733a6ba1a 100644 --- a/drivers/input/keyboard/applespi.c +++ b/drivers/input/keyboard/applespi.c @@ -48,12 +48,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include @@ -411,7 +411,13 @@ struct applespi_data { boolread_active; boolwrite_active; - struct work_struct work; + struct applespi_complete_info { + void(*complete)(void *context); + struct applespi_data*applespi; + } spi_complete[2]; + boolcancel_spi; + + wait_queue_head_t tp_info_complete; struct touchpad_info_protocol rcvd_tp_info; struct dentry *debugfs_root; @@ -593,13 +599,61 @@ static void applespi_setup_write_txfrs(struct applespi_data *applespi) spi_message_add_tail(st_t, msg); } +static bool applespi_async_outstanding(struct applespi_data *applespi) +{ + return applespi->spi_complete[0].complete || + applespi->spi_complete[1].complete; +} + +static void applespi_async_complete(void *context) +{ + struct applespi_complete_info *info = context; + struct applespi_data *applespi = info->applespi; + unsigned long flags; + + info-
Re: [PATCH v5 0/5] Add HDMI jack support on RK3288
On Wed, Jul 17, 2019 at 4:33 PM Cheng-Yi Chiang wrote: > > This patch series supports HDMI jack reporting on RK3288, which uses > DRM dw-hdmi driver and hdmi-codec codec driver. > > The previous discussion about reporting jack status using hdmi-notifier > and drm_audio_component is at > > https://lore.kernel.org/patchwork/patch/1083027/ > > The new approach is to use a callback mechanism that is > specific to hdmi-codec. > > Changes from v4 to v5: > - synopsys/Kconfig: Remove the incorrect dependency change in v4. > - rockchip/Kconfig: Add dependency of hdmi-codec when it is really need > for jack support. > > Cheng-Yi Chiang (5): > ASoC: hdmi-codec: Add an op to set callback function for plug event > drm: bridge: dw-hdmi: Report connector status using callback > drm: dw-hdmi-i2s: Use fixed id for codec device > ASoC: rockchip_max98090: Add dai_link for HDMI > ASoC: rockchip_max98090: Add HDMI jack support > LGTM. Reviewed-by: Tzung-Bi Shih
Re: [PATCH v2 0/19] drm: drop use of drmp.h in drm-misc
On Tue, Jul 16, 2019 at 08:50:22AM +0200, Sam Ravnborg wrote: > Copied all recipients on the cover letter. > As the list is long this mail may not hit the mailing lists. > > Sam > > On Tue, Jul 16, 2019 at 08:42:01AM +0200, Sam Ravnborg wrote: > > This patch set removes a far share of the remaining uses of drmP.h. > > Common for all patches are that the respective files are maintained > > in drm-misc. > > All patches are independent. > > > > Patches have all been build tested with various configs and various > > architectures. > > There are likely introduced a few build issues that randconfig > > build will reveal, but for all configs I have used the build was OK. > > > > This patchset does not conclude the quest to kill all uses > > of drmP.h, but it is a major step towards the goal. > > > > Please review/ack. > > I plan to apply the patches to drm-misc, but feel free > > to do it yourself. > > > > There will be conflicts with the ongoing work on ttm, gem etc. > > But let's deal with the conflicts when they hit us - it > > is simple conflicts in the list of include files. > > > > v2: > > - Removed merged patches > > - Added ack from Emil Velikov to the full series > > - Rebased on top of drm-misc-next > > - Hand-edited the list of Cc: as get_maintainer.pl in some > > cases looks up too much people, due to cross kernel commits I have collected the additional r-bs and acks and pushed out the full series. Thanks for feedback to everyone! Sam ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 2/2] docs: gpu: add msm-crash-dump.rst to the index.rst file
This file is currently orphaned. Signed-off-by: Mauro Carvalho Chehab --- Documentation/gpu/drivers.rst| 1 + Documentation/gpu/msm-crash-dump.rst | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Documentation/gpu/drivers.rst b/Documentation/gpu/drivers.rst index 4bfb7068e9f7..6c88c57b90cf 100644 --- a/Documentation/gpu/drivers.rst +++ b/Documentation/gpu/drivers.rst @@ -20,6 +20,7 @@ GPU Driver Documentation xen-front afbc komeda-kms + msm-crash-dump .. only:: subproject and html diff --git a/Documentation/gpu/msm-crash-dump.rst b/Documentation/gpu/msm-crash-dump.rst index 240ef200f76c..757cd257e0d8 100644 --- a/Documentation/gpu/msm-crash-dump.rst +++ b/Documentation/gpu/msm-crash-dump.rst @@ -1,5 +1,3 @@ -:orphan: - = MSM Crash Dump Format = -- 2.21.0
Re: [PATCH] drm/arm/mali-dp: Add display QoS interface configuration
Hi Wen, On Wed, Jul 17, 2019 at 05:23:53PM +0800, Wen He wrote: > Configure the display Quality of service (QoS) levels to high priority > if the level is defined as high as in DTS. The ARQOS for DP500 is driven > from the "RQOS" register, needed to program the RQOS register value < 7 > for the 4k resolution flicker to disappear on the LS1028A platform. Thanks for taking time to come up with a more generic patch for your issue! I have a question: what happens if you program the MALIDP500_RQOS_QUALITY register to 0xd000d000 for all pixelclocks? Also, some suggestions further down: > > Signed-off-by: Wen He > --- > change in v2: > - add new implementation for 4k flicker issue on the LS1028A > > drivers/gpu/drm/arm/malidp_drv.c | 5 + > drivers/gpu/drm/arm/malidp_hw.c | 13 + > drivers/gpu/drm/arm/malidp_hw.h | 3 +++ > drivers/gpu/drm/arm/malidp_regs.h | 12 > 4 files changed, 33 insertions(+) > > diff --git a/drivers/gpu/drm/arm/malidp_drv.c > b/drivers/gpu/drm/arm/malidp_drv.c > index f25ec4382277..d2b2cf52ac87 100644 > --- a/drivers/gpu/drm/arm/malidp_drv.c > +++ b/drivers/gpu/drm/arm/malidp_drv.c > @@ -818,6 +818,11 @@ static int malidp_bind(struct device *dev) > > malidp->core_id = version; > > + hwdev->arqos_high_level = false; This is not needed. > + > + hwdev->arqos_high_level = of_property_read_bool(dev->of_node, > + "arm,malidp-arqos-high-level"); I think it would be better to have this property as a u32 value, rather than a boolean, and put the value that we want to program MALIDP_RQOS_QUALITY with in there. Also, you need to add the documentation for this optional property in Documentation/devicetree/bindings/display/arm,malidp.txt. > + > /* set the number of lines used for output of RGB data */ > ret = of_property_read_u8_array(dev->of_node, > "arm,malidp-output-port-lines", > diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c > index 50af399d7f6f..eaa1658cd86b 100644 > --- a/drivers/gpu/drm/arm/malidp_hw.c > +++ b/drivers/gpu/drm/arm/malidp_hw.c > @@ -374,6 +374,19 @@ static void malidp500_modeset(struct malidp_hw_device > *hwdev, struct videomode * > malidp_hw_setbits(hwdev, MALIDP_DISP_FUNC_ILACED, > MALIDP_DE_DISPLAY_FUNC); > else > malidp_hw_clearbits(hwdev, MALIDP_DISP_FUNC_ILACED, > MALIDP_DE_DISPLAY_FUNC); > + > + /* > + * Program the RQoS register to increasing QoS levels for > + * the 4k resolution flicker to disappear on the LS1028A. Looks like two sentences got smashed into one, the result is a bit hard to read. Best regards, Liviu > + */ > + if (hwdev->arqos_high_level) { > + val = RED_ARQOS_VALUE | GREEN_ARQOS_VALUE; > + > + if (mode->pixelclock == 59400) > + malidp_hw_setbits(hwdev, val, MALIDP500_RQOS_QUALITY); > + else > + malidp_hw_clearbits(hwdev, val, MALIDP500_RQOS_QUALITY); > + } > } > > int malidp_format_get_bpp(u32 fmt) > diff --git a/drivers/gpu/drm/arm/malidp_hw.h b/drivers/gpu/drm/arm/malidp_hw.h > index 968a65eed371..b8baba60508a 100644 > --- a/drivers/gpu/drm/arm/malidp_hw.h > +++ b/drivers/gpu/drm/arm/malidp_hw.h > @@ -251,6 +251,9 @@ struct malidp_hw_device { > > /* size of memory used for rotating layers, up to two banks available */ > u32 rotation_memory[2]; > + > + /* priority level of RQOS register used for driven the ARQOS signal */ > + bool arqos_high_level; > }; > > static inline u32 malidp_hw_read(struct malidp_hw_device *hwdev, u32 reg) > diff --git a/drivers/gpu/drm/arm/malidp_regs.h > b/drivers/gpu/drm/arm/malidp_regs.h > index 993031542fa1..08842142b3b2 100644 > --- a/drivers/gpu/drm/arm/malidp_regs.h > +++ b/drivers/gpu/drm/arm/malidp_regs.h > @@ -210,6 +210,18 @@ > #define MALIDP500_CONFIG_VALID 0x00f00 > #define MALIDP500_CONFIG_ID 0x00fd4 > > +/* > + * The quality of service (QoS) register on the DP500. RQOS register values > + * are driven by the ARQOS signal, using AXI transacations, dependent on the > + * FIFO input level. > + * The RQOS register can also set QoS levels for: > + *- RED_ARQOS @ A 4-bit signal value for close to underflow conditions > + *- GREEN_ARQOS @ A 4-bit signal value for normal conditions > + */ > +#define MALIDP500_RQOS_QUALITY 0x00500 > +#define RED_ARQOS_VALUE (0xd << 12) > +#define GREEN_ARQOS_VALUE (0xd << 28) > + > /* register offsets and bits specific to DP550/DP650 */ > #define MALIDP550_ADDR_SPACE_SIZE0x1 > #define MALIDP550_DE_CONTROL 0x00010 > -- > 2.17.1 > -- | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --- ¯\_(ツ)_/¯
Re: next/master boot: 265 boots: 17 failed, 243 passed with 4 offline, 1 conflict (next-20190717)
On Wed, Jul 17, 2019 at 04:27:56AM -0700, kernelci.org bot wrote: Today's -next fails to boot on meson-gxm-khadas-vim2 in a variety of configurations: > defconfig: > gcc-8: > meson-gxm-khadas-vim2: > lab-baylibre: new failure (last pass: next-20190705) > defconfig+CONFIG_CPU_BIG_ENDIAN=y: > gcc-8: > meson-gxm-khadas-vim2: > lab-baylibre: new failure (last pass: next-20190705) > defconfig+CONFIG_RANDOMIZE_BASE=y: > gcc-8: > meson-gxm-khadas-vim2: > lab-baylibre: new failure (last pass: next-20190705) It looks like it gets to userspace and then hangs (end of the log below). More details at: https://kernelci.org/boot/id/5d2ed6ad59b514a0e649e937/ Compared to working boots in mainline it looks like the main difference is the addition of the panfrost driver but that could be a complete red herring. 08:00:51.567064 [ 14.844034] Run /init as init process 08:00:51.590902 Starting syslogd: OK 08:00:51.645937 Starting klogd: OK 08:00:51.650193 Populating /dev using udev: [ 14.894327] udevd[214]: starting version 3.2.7 08:00:51.651409 [ 14.894906] random: udevd: uninitialized urandom read (16 bytes read) 08:00:51.652703 [ 14.899720] random: udevd: uninitialized urandom read (16 bytes read) 08:00:51.653946 [ 14.905958] random: udevd: uninitialized urandom read (16 bytes read) 08:00:51.655192 [ 14.913972] udevd[214]: specified group 'kvm' unknown 08:00:51.656495 [ 14.920901] udevd[215]: starting eudev-3.2.7 08:00:51.790817 [BL31]: tee size: 0 08:00:51.820838 [ 15.089001] meson-gx-mmc d007.mmc: allocated mmc-pwrseq 08:00:51.860744 [ 15.106647] meson8b-dwmac c941.ethernet: PTP uses main clock 08:00:51.865096 [ 15.107020] meson8b-dwmac c941.ethernet: no reset control found 08:00:51.866318 [ 15.114743] meson8b-dwmac c941.ethernet: User ID: 0x11, Synopsys ID: 0x37 08:00:51.867556 [ 15.120434] meson8b-dwmac c941.ethernet: DWMAC1000 08:00:51.868872 [ 15.123055] panfrost d00c.gpu: clock rate = 6 08:00:51.870123 [ 15.125580] meson8b-dwmac c941.ethernet: DMA HW capability register supported 08:00:51.871365 [ 15.126609] meson-drm d010.vpu: Queued 2 outputs on vpu 08:00:51.903478 [ 15.131066] panfrost d00c.gpu: mali-t820 id 0x820 major 0x1 minor 0x0 status 0x0 08:00:51.907981 [ 15.138262] meson8b-dwmac c941.ethernet: RX Checksum Offload Engine supported 08:00:51.909205 [ 15.138269] meson8b-dwmac c941.ethernet: COE Type 2 08:00:51.910449 [ 15.143806] panfrost d00c.gpu: features: ,101e76ff, issues: ,24040400 08:00:51.911698 [ 15.145058] Bluetooth: Core ver 2.22 08:00:51.913009 [ 15.145170] NET: Registered protocol family 31 08:00:51.914253 [ 15.145175] Bluetooth: HCI device and connection manager initialized 08:00:51.919829 [ 15.145197] Bluetooth: HCI socket layer initialized 08:02:48.216650 ShellCommand command timed out.: Sending # in case of corruption. Connection timeout 00:04:20, retry in 00:02:10 08:02:48.321432 # signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 02/10] drm/tinydrm: Use spi_is_bpw_supported()
This means that tinydrm_spi_bpw_supported() can be removed. Signed-off-by: Noralf Trønnes --- .../gpu/drm/tinydrm/core/tinydrm-helpers.c| 32 +-- drivers/gpu/drm/tinydrm/mipi-dbi.c| 5 ++- include/drm/tinydrm/tinydrm-helpers.h | 1 - 3 files changed, 3 insertions(+), 35 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c index dfeafac4c656..aeb49cefed25 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c @@ -53,36 +53,6 @@ size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len) } EXPORT_SYMBOL(tinydrm_spi_max_transfer_size); -/** - * tinydrm_spi_bpw_supported - Check if bits per word is supported - * @spi: SPI device - * @bpw: Bits per word - * - * This function checks to see if the SPI master driver supports @bpw. - * - * Returns: - * True if @bpw is supported, false otherwise. - */ -bool tinydrm_spi_bpw_supported(struct spi_device *spi, u8 bpw) -{ - u32 bpw_mask = spi->master->bits_per_word_mask; - - if (bpw == 8) - return true; - - if (!bpw_mask) { - dev_warn_once(&spi->dev, - "bits_per_word_mask not set, assume 8-bit only\n"); - return false; - } - - if (bpw_mask & SPI_BPW_MASK(bpw)) - return true; - - return false; -} -EXPORT_SYMBOL(tinydrm_spi_bpw_supported); - static void tinydrm_dbg_spi_print(struct spi_device *spi, struct spi_transfer *tr, const void *buf, int idx, bool tx) @@ -159,7 +129,7 @@ int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, pr_debug("[drm:%s] bpw=%u, max_chunk=%zu, transfers:\n", __func__, bpw, max_chunk); - if (bpw == 16 && !tinydrm_spi_bpw_supported(spi, 16)) { + if (bpw == 16 && !spi_is_bpw_supported(spi, 16)) { tr.bits_per_word = 8; if (tinydrm_machine_little_endian()) { swap_buf = kmalloc(min(len, max_chunk), GFP_KERNEL); diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 791a0b43beef..b6c46453e904 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -782,7 +782,7 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *mipi, int dc, u16 *dst16; int ret; - if (!tinydrm_spi_bpw_supported(spi, 9)) + if (!spi_is_bpw_supported(spi, 9)) return mipi_dbi_spi1e_transfer(mipi, dc, buf, len, bpw); tr.speed_hz = mipi_dbi_spi_cmd_max_speed(spi, len); @@ -1003,8 +1003,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, if (dc) { mipi->command = mipi_dbi_typec3_command; mipi->dc = dc; - if (tinydrm_machine_little_endian() && - !tinydrm_spi_bpw_supported(spi, 16)) + if (tinydrm_machine_little_endian() && !spi_is_bpw_supported(spi, 16)) mipi->swap_bytes = true; } else { mipi->command = mipi_dbi_typec1_command; diff --git a/include/drm/tinydrm/tinydrm-helpers.h b/include/drm/tinydrm/tinydrm-helpers.h index f8bcadf48cb1..146bc383297c 100644 --- a/include/drm/tinydrm/tinydrm-helpers.h +++ b/include/drm/tinydrm/tinydrm-helpers.h @@ -43,7 +43,6 @@ int tinydrm_display_pipe_init(struct drm_device *drm, unsigned int rotation); size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len); -bool tinydrm_spi_bpw_supported(struct spi_device *spi, u8 bpw); int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, struct spi_transfer *header, u8 bpw, const void *buf, size_t len); -- 2.20.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 05/10] drm/tinydrm: Clean up tinydrm_spi_transfer()
Prep work before moving the function to mipi-dbi. tinydrm_spi_transfer() was made to support one class of drivers in drivers/staging/fbtft that has not been converted to DRM yet, so strip away the unused functionality: - Start byte (header) is not used. - No driver relies on the automatic 16-bit byte swapping on little endian machines with SPI controllers only supporting 8 bits per word. Other changes: - No need to initialize ret - No need for the WARN since mipi-dbi only uses 8 and 16 bpw. - Use spi_message_init_with_transfers() Cc: David Lechner Signed-off-by: Noralf Trønnes --- .../gpu/drm/tinydrm/core/tinydrm-helpers.c| 40 ++- drivers/gpu/drm/tinydrm/ili9225.c | 4 +- drivers/gpu/drm/tinydrm/mipi-dbi.c| 4 +- include/drm/tinydrm/tinydrm-helpers.h | 3 +- 4 files changed, 9 insertions(+), 42 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c index af5bec8861de..d95eb50fa9d4 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c @@ -24,23 +24,18 @@ * tinydrm_spi_transfer - SPI transfer helper * @spi: SPI device * @speed_hz: Override speed (optional) - * @header: Optional header transfer * @bpw: Bits per word * @buf: Buffer to transfer * @len: Buffer length * * This SPI transfer helper breaks up the transfer of @buf into chunks which - * the SPI master driver can handle. If the machine is Little Endian and the - * SPI master driver doesn't support 16 bits per word, it swaps the bytes and - * does a 8-bit transfer. - * If @header is set, it is prepended to each SPI message. + * the SPI controller driver can handle. * * Returns: * Zero on success, negative error code on failure. */ int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, -struct spi_transfer *header, u8 bpw, const void *buf, -size_t len) +u8 bpw, const void *buf, size_t len) { size_t max_chunk = spi_max_transfer_size(spi); struct spi_transfer tr = { @@ -48,43 +43,16 @@ int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, .speed_hz = speed_hz, }; struct spi_message m; - u16 *swap_buf = NULL; size_t chunk; - int ret = 0; + int ret; - if (WARN_ON_ONCE(bpw != 8 && bpw != 16)) - return -EINVAL; - - if (bpw == 16 && !spi_is_bpw_supported(spi, 16)) { - tr.bits_per_word = 8; - if (tinydrm_machine_little_endian()) { - swap_buf = kmalloc(min(len, max_chunk), GFP_KERNEL); - if (!swap_buf) - return -ENOMEM; - } - } - - spi_message_init(&m); - if (header) - spi_message_add_tail(header, &m); - spi_message_add_tail(&tr, &m); + spi_message_init_with_transfers(&m, &tr, 1); while (len) { chunk = min(len, max_chunk); tr.tx_buf = buf; tr.len = chunk; - - if (swap_buf) { - const u16 *buf16 = buf; - unsigned int i; - - for (i = 0; i < chunk / 2; i++) - swap_buf[i] = swab16(buf16[i]); - - tr.tx_buf = swap_buf; - } - buf += chunk; len -= chunk; diff --git a/drivers/gpu/drm/tinydrm/ili9225.c b/drivers/gpu/drm/tinydrm/ili9225.c index 7a8e1b4a37ee..21677e3ed38b 100644 --- a/drivers/gpu/drm/tinydrm/ili9225.c +++ b/drivers/gpu/drm/tinydrm/ili9225.c @@ -323,7 +323,7 @@ static int ili9225_dbi_command(struct mipi_dbi *mipi, u8 *cmd, u8 *par, gpiod_set_value_cansleep(mipi->dc, 0); speed_hz = mipi_dbi_spi_cmd_max_speed(spi, 1); - ret = tinydrm_spi_transfer(spi, speed_hz, NULL, 8, cmd, 1); + ret = tinydrm_spi_transfer(spi, speed_hz, 8, cmd, 1); if (ret || !num) return ret; @@ -333,7 +333,7 @@ static int ili9225_dbi_command(struct mipi_dbi *mipi, u8 *cmd, u8 *par, gpiod_set_value_cansleep(mipi->dc, 1); speed_hz = mipi_dbi_spi_cmd_max_speed(spi, num); - return tinydrm_spi_transfer(spi, speed_hz, NULL, bpw, par, num); + return tinydrm_spi_transfer(spi, speed_hz, bpw, par, num); } static const struct drm_simple_display_pipe_funcs ili9225_pipe_funcs = { diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index ae31a5c9aa1b..8fb6ce4ca6fc 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -926,7 +926,7 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, u8 *cmd, gpiod_set_value_cansleep(mipi->dc, 0); speed_hz = mipi_dbi_spi_cmd_max_speed(spi, 1); - ret = tinydrm_spi_transfer(spi, speed_h
[PATCH 00/10] drm/tinydrm: Remove tinydrm.ko
This series removes the remaining bits of tinydrm.ko. There's only one item left on the tinydrm todo list and that is moving out mipi_dbi. Note: This depends on a commit that just entered Linus' tree: e6f3f7e4dc76 ("spi: Add spi_is_bpw_supported()") Series is also available here: https://github.com/notro/linux/tree/remove_tinydrm_ko Noralf. Noralf Trønnes (10): drm: Add SPI connector type drm/tinydrm: Use spi_is_bpw_supported() drm/tinydrm: Remove spi debug buffer dumping drm/tinydrm: Remove tinydrm_spi_max_transfer_size() drm/tinydrm: Clean up tinydrm_spi_transfer() drm/tinydrm: Move tinydrm_spi_transfer() drm/tinydrm: Move tinydrm_machine_little_endian() drm/tinydrm/repaper: Don't use tinydrm_display_pipe_init() drm/tinydrm/mipi-dbi: Add mipi_dbi_init_with_formats() drm/tinydrm: Move tinydrm_display_pipe_init() to mipi-dbi Documentation/gpu/tinydrm.rst | 12 - Documentation/gpu/todo.rst| 3 - drivers/gpu/drm/drm_connector.c | 1 + drivers/gpu/drm/tinydrm/Makefile | 1 - drivers/gpu/drm/tinydrm/core/Makefile | 4 - .../gpu/drm/tinydrm/core/tinydrm-helpers.c| 207 -- drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 179 drivers/gpu/drm/tinydrm/hx8357d.c | 1 - drivers/gpu/drm/tinydrm/ili9225.c | 5 +- drivers/gpu/drm/tinydrm/ili9341.c | 1 - drivers/gpu/drm/tinydrm/mi0283qt.c| 1 - drivers/gpu/drm/tinydrm/mipi-dbi.c| 254 ++ drivers/gpu/drm/tinydrm/repaper.c | 58 +++- drivers/gpu/drm/tinydrm/st7586.c | 32 +-- drivers/gpu/drm/tinydrm/st7735r.c | 1 - include/drm/tinydrm/mipi-dbi.h| 22 +- include/drm/tinydrm/tinydrm-helpers.h | 75 -- include/uapi/drm/drm_mode.h | 1 + 18 files changed, 285 insertions(+), 573 deletions(-) delete mode 100644 drivers/gpu/drm/tinydrm/core/Makefile delete mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c delete mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c delete mode 100644 include/drm/tinydrm/tinydrm-helpers.h -- 2.20.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 09/10] drm/tinydrm/mipi-dbi: Add mipi_dbi_init_with_formats()
The MIPI DBI standard support more pixel formats than what this helper supports. Add an init function that lets the driver use different format(s). This avoids open coding mipi_dbi_init() in st7586. st7586 sets preferred_depth but this is not necessary since it only supports one format. Cc: David Lechner Signed-off-by: Noralf Trønnes --- drivers/gpu/drm/tinydrm/mipi-dbi.c | 91 +- drivers/gpu/drm/tinydrm/st7586.c | 32 ++- include/drm/tinydrm/mipi-dbi.h | 5 ++ 3 files changed, 74 insertions(+), 54 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 73db287e5c52..a264c0bb74b0 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -411,6 +411,65 @@ static const uint32_t mipi_dbi_formats[] = { DRM_FORMAT_XRGB, }; +/** + * mipi_dbi_init_with_formats - MIPI DBI initialization with custom formats + * @mipi: &mipi_dbi structure to initialize + * @funcs: Display pipe functions + * @formats: Array of supported formats (DRM_FORMAT\_\*). + * @format_count: Number of elements in @formats + * @mode: Display mode + * @rotation: Initial rotation in degrees Counter Clock Wise + * @tx_buf_size: Allocate a transmit buffer of this size. + * + * This function sets up a &drm_simple_display_pipe with a &drm_connector that + * has one fixed &drm_display_mode which is rotated according to @rotation. + * This mode is used to set the mode config min/max width/height properties. + * + * Use mipi_dbi_init() if you don't need custom formats. + * + * Note: + * Some of the helper functions expects RGB565 to be the default format and the + * transmit buffer sized to fit that. + * + * Returns: + * Zero on success, negative error code on failure. + */ +int mipi_dbi_init_with_formats(struct mipi_dbi *mipi, + const struct drm_simple_display_pipe_funcs *funcs, + const uint32_t *formats, unsigned int format_count, + const struct drm_display_mode *mode, + unsigned int rotation, size_t tx_buf_size) +{ + struct drm_device *drm = &mipi->drm; + int ret; + + if (!mipi->command) + return -EINVAL; + + mutex_init(&mipi->cmdlock); + + mipi->tx_buf = devm_kmalloc(drm->dev, tx_buf_size, GFP_KERNEL); + if (!mipi->tx_buf) + return -ENOMEM; + + ret = tinydrm_display_pipe_init(drm, &mipi->pipe, funcs, + DRM_MODE_CONNECTOR_SPI, + formats, format_count, mode, + rotation); + if (ret) + return ret; + + drm_plane_enable_fb_damage_clips(&mipi->pipe.plane); + + drm->mode_config.funcs = &mipi_dbi_mode_config_funcs; + mipi->rotation = rotation; + + DRM_DEBUG_KMS("rotation = %u\n", rotation); + + return 0; +} +EXPORT_SYMBOL(mipi_dbi_init_with_formats); + /** * mipi_dbi_init - MIPI DBI initialization * @mipi: &mipi_dbi structure to initialize @@ -433,36 +492,12 @@ int mipi_dbi_init(struct mipi_dbi *mipi, const struct drm_display_mode *mode, unsigned int rotation) { size_t bufsize = mode->vdisplay * mode->hdisplay * sizeof(u16); - struct drm_device *drm = &mipi->drm; - int ret; - if (!mipi->command) - return -EINVAL; + mipi->drm.mode_config.preferred_depth = 16; - mutex_init(&mipi->cmdlock); - - mipi->tx_buf = devm_kmalloc(drm->dev, bufsize, GFP_KERNEL); - if (!mipi->tx_buf) - return -ENOMEM; - - ret = tinydrm_display_pipe_init(drm, &mipi->pipe, funcs, - DRM_MODE_CONNECTOR_SPI, - mipi_dbi_formats, - ARRAY_SIZE(mipi_dbi_formats), mode, - rotation); - if (ret) - return ret; - - drm_plane_enable_fb_damage_clips(&mipi->pipe.plane); - - drm->mode_config.funcs = &mipi_dbi_mode_config_funcs; - drm->mode_config.preferred_depth = 16; - mipi->rotation = rotation; - - DRM_DEBUG_KMS("preferred_depth=%u, rotation = %u\n", - drm->mode_config.preferred_depth, rotation); - - return 0; + return mipi_dbi_init_with_formats(mipi, funcs, mipi_dbi_formats, + ARRAY_SIZE(mipi_dbi_formats), mode, + rotation, bufsize); } EXPORT_SYMBOL(mipi_dbi_init); diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c index 7ae39004aa88..650ca8d4732e 100644 --- a/drivers/gpu/drm/tinydrm/st7586.c +++ b/drivers/gpu/drm/tinydrm/st7586.c @@ -24,7 +24,6 @@ #include #include #include -#include /* controller-specific commands */ #define ST7586_DISP_MODE_GRAY 0x
[PATCH 07/10] drm/tinydrm: Move tinydrm_machine_little_endian()
The tinydrm helper is going away so move it into the only user mipi-dbi. Signed-off-by: Noralf Trønnes --- drivers/gpu/drm/tinydrm/mipi-dbi.c| 15 --- include/drm/tinydrm/tinydrm-helpers.h | 15 --- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 6a8f2d66377f..73db287e5c52 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -628,6 +628,15 @@ u32 mipi_dbi_spi_cmd_max_speed(struct spi_device *spi, size_t len) } EXPORT_SYMBOL(mipi_dbi_spi_cmd_max_speed); +static bool mipi_dbi_machine_little_endian(void) +{ +#if defined(__LITTLE_ENDIAN) + return true; +#else + return false; +#endif +} + /* * MIPI DBI Type C Option 1 * @@ -650,7 +659,7 @@ static int mipi_dbi_spi1e_transfer(struct mipi_dbi *mipi, int dc, const void *buf, size_t len, unsigned int bpw) { - bool swap_bytes = (bpw == 16 && tinydrm_machine_little_endian()); + bool swap_bytes = (bpw == 16 && mipi_dbi_machine_little_endian()); size_t chunk, max_chunk = mipi->tx_buf9_len; struct spi_device *spi = mipi->spi; struct spi_transfer tr = { @@ -799,7 +808,7 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *mipi, int dc, size_t chunk = min(len, max_chunk); unsigned int i; - if (bpw == 16 && tinydrm_machine_little_endian()) { + if (bpw == 16 && mipi_dbi_machine_little_endian()) { for (i = 0; i < (chunk * 2); i += 2) { dst16[i] = *src16 >> 8; dst16[i + 1] = *src16++ & 0xFF; @@ -991,7 +1000,7 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, if (dc) { mipi->command = mipi_dbi_typec3_command; mipi->dc = dc; - if (tinydrm_machine_little_endian() && !spi_is_bpw_supported(spi, 16)) + if (mipi_dbi_machine_little_endian() && !spi_is_bpw_supported(spi, 16)) mipi->swap_bytes = true; } else { mipi->command = mipi_dbi_typec1_command; diff --git a/include/drm/tinydrm/tinydrm-helpers.h b/include/drm/tinydrm/tinydrm-helpers.h index 8c5d20efeaa1..0e7470771c5e 100644 --- a/include/drm/tinydrm/tinydrm-helpers.h +++ b/include/drm/tinydrm/tinydrm-helpers.h @@ -15,21 +15,6 @@ struct drm_simple_display_pipe; struct drm_simple_display_pipe_funcs; struct device; -/** - * tinydrm_machine_little_endian - Machine is little endian - * - * Returns: - * true if *defined(__LITTLE_ENDIAN)*, false otherwise - */ -static inline bool tinydrm_machine_little_endian(void) -{ -#if defined(__LITTLE_ENDIAN) - return true; -#else - return false; -#endif -} - int tinydrm_display_pipe_init(struct drm_device *drm, struct drm_simple_display_pipe *pipe, const struct drm_simple_display_pipe_funcs *funcs, -- 2.20.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 03/10] drm/tinydrm: Remove spi debug buffer dumping
The SPI event tracing can dump the buffer now so no need for this. Remove the debug print from tinydrm_spi_transfer() since this info can be gleaned from the trace event. Signed-off-by: Noralf Trønnes --- .../gpu/drm/tinydrm/core/tinydrm-helpers.c| 40 --- drivers/gpu/drm/tinydrm/mipi-dbi.c| 6 --- include/drm/tinydrm/tinydrm-helpers.h | 25 3 files changed, 71 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c index aeb49cefed25..272616a246cd 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c @@ -53,41 +53,6 @@ size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len) } EXPORT_SYMBOL(tinydrm_spi_max_transfer_size); -static void -tinydrm_dbg_spi_print(struct spi_device *spi, struct spi_transfer *tr, - const void *buf, int idx, bool tx) -{ - u32 speed_hz = tr->speed_hz ? tr->speed_hz : spi->max_speed_hz; - char linebuf[3 * 32]; - - hex_dump_to_buffer(buf, tr->len, 16, - DIV_ROUND_UP(tr->bits_per_word, 8), - linebuf, sizeof(linebuf), false); - - printk(KERN_DEBUG - "tr(%i): speed=%u%s, bpw=%i, len=%u, %s_buf=[%s%s]\n", idx, - speed_hz > 100 ? speed_hz / 100 : speed_hz / 1000, - speed_hz > 100 ? "MHz" : "kHz", tr->bits_per_word, tr->len, - tx ? "tx" : "rx", linebuf, tr->len > 16 ? " ..." : ""); -} - -/* called through tinydrm_dbg_spi_message() */ -void _tinydrm_dbg_spi_message(struct spi_device *spi, struct spi_message *m) -{ - struct spi_transfer *tmp; - int i = 0; - - list_for_each_entry(tmp, &m->transfers, transfer_list) { - - if (tmp->tx_buf) - tinydrm_dbg_spi_print(spi, tmp, tmp->tx_buf, i, true); - if (tmp->rx_buf) - tinydrm_dbg_spi_print(spi, tmp, tmp->rx_buf, i, false); - i++; - } -} -EXPORT_SYMBOL(_tinydrm_dbg_spi_message); - /** * tinydrm_spi_transfer - SPI transfer helper * @spi: SPI device @@ -125,10 +90,6 @@ int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, max_chunk = tinydrm_spi_max_transfer_size(spi, 0); - if (drm_debug & DRM_UT_DRIVER) - pr_debug("[drm:%s] bpw=%u, max_chunk=%zu, transfers:\n", -__func__, bpw, max_chunk); - if (bpw == 16 && !spi_is_bpw_supported(spi, 16)) { tr.bits_per_word = 8; if (tinydrm_machine_little_endian()) { @@ -162,7 +123,6 @@ int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, buf += chunk; len -= chunk; - tinydrm_dbg_spi_message(spi, &m); ret = spi_sync(spi, &m); if (ret) return ret; diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index b6c46453e904..99509d16b037 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -679,8 +679,6 @@ static int mipi_dbi_spi1e_transfer(struct mipi_dbi *mipi, int dc, dst[8] = *src; tr.len = 9; - tinydrm_dbg_spi_message(spi, &m); - return spi_sync(spi, &m); } @@ -758,7 +756,6 @@ static int mipi_dbi_spi1e_transfer(struct mipi_dbi *mipi, int dc, tr.len = chunk + added; - tinydrm_dbg_spi_message(spi, &m); ret = spi_sync(spi, &m); if (ret) return ret; @@ -822,7 +819,6 @@ static int mipi_dbi_spi1_transfer(struct mipi_dbi *mipi, int dc, tr.len = chunk; len -= chunk; - tinydrm_dbg_spi_message(spi, &m); ret = spi_sync(spi, &m); if (ret) return ret; @@ -898,8 +894,6 @@ static int mipi_dbi_typec3_command_read(struct mipi_dbi *mipi, u8 *cmd, if (ret) goto err_free; - tinydrm_dbg_spi_message(spi, &m); - if (tr[1].len == len) { memcpy(data, buf, len); } else { diff --git a/include/drm/tinydrm/tinydrm-helpers.h b/include/drm/tinydrm/tinydrm-helpers.h index 146bc383297c..dca75de3a359 100644 --- a/include/drm/tinydrm/tinydrm-helpers.h +++ b/include/drm/tinydrm/tinydrm-helpers.h @@ -14,7 +14,6 @@ struct drm_rect; struct drm_simple_display_pipe; struct drm_simple_display_pipe_funcs; struct spi_transfer; -struct spi_message; struct spi_device; struct device; @@ -46,29 +45,5 @@ size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len); int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, struct spi_transfer *header, u8 bpw, const void *buf, size_t len); -void
[PATCH 08/10] drm/tinydrm/repaper: Don't use tinydrm_display_pipe_init()
tinydrm.ko is going away so let's implement a connector. Signed-off-by: Noralf Trønnes --- drivers/gpu/drm/tinydrm/repaper.c | 58 --- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/repaper.c b/drivers/gpu/drm/tinydrm/repaper.c index 40afa66107e5..76d179200775 100644 --- a/drivers/gpu/drm/tinydrm/repaper.c +++ b/drivers/gpu/drm/tinydrm/repaper.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -30,10 +31,11 @@ #include #include #include +#include #include #include +#include #include -#include #define REPAPER_RID_G2_COG_ID 0x12 @@ -60,6 +62,8 @@ enum repaper_epd_border_byte { struct repaper_epd { struct drm_device drm; struct drm_simple_display_pipe pipe; + const struct drm_display_mode *mode; + struct drm_connector connector; struct spi_device *spi; struct gpio_desc *panel_on; @@ -873,6 +877,39 @@ static const struct drm_simple_display_pipe_funcs repaper_pipe_funcs = { .prepare_fb = drm_gem_fb_simple_display_pipe_prepare_fb, }; +static int repaper_connector_get_modes(struct drm_connector *connector) +{ + struct repaper_epd *epd = drm_to_epd(connector->dev); + struct drm_display_mode *mode; + + mode = drm_mode_duplicate(connector->dev, epd->mode); + if (!mode) { + DRM_ERROR("Failed to duplicate mode\n"); + return 0; + } + + drm_mode_set_name(mode); + mode->type |= DRM_MODE_TYPE_PREFERRED; + drm_mode_probed_add(connector, mode); + + connector->display_info.width_mm = mode->width_mm; + connector->display_info.height_mm = mode->height_mm; + + return 1; +} + +static const struct drm_connector_helper_funcs repaper_connector_hfuncs = { + .get_modes = repaper_connector_get_modes, +}; + +static const struct drm_connector_funcs repaper_connector_funcs = { + .reset = drm_atomic_helper_connector_reset, + .fill_modes = drm_helper_probe_single_connector_modes, + .destroy = drm_connector_cleanup, + .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, +}; + static const struct drm_mode_config_funcs repaper_mode_config_funcs = { .fb_create = drm_gem_fb_create_with_dirty, .atomic_check = drm_atomic_helper_check, @@ -1095,6 +1132,7 @@ static int repaper_probe(struct spi_device *spi) return -ENODEV; } + epd->mode = mode; epd->width = mode->hdisplay; epd->height = mode->vdisplay; epd->factored_stage_time = epd->stage_time; @@ -1109,10 +1147,20 @@ static int repaper_probe(struct spi_device *spi) if (!epd->current_frame) return -ENOMEM; - ret = tinydrm_display_pipe_init(drm, &epd->pipe, &repaper_pipe_funcs, - DRM_MODE_CONNECTOR_SPI, - repaper_formats, - ARRAY_SIZE(repaper_formats), mode, 0); + drm->mode_config.min_width = mode->hdisplay; + drm->mode_config.max_width = mode->hdisplay; + drm->mode_config.min_height = mode->vdisplay; + drm->mode_config.max_height = mode->vdisplay; + + drm_connector_helper_add(&epd->connector, &repaper_connector_hfuncs); + ret = drm_connector_init(drm, &epd->connector, &repaper_connector_funcs, +DRM_MODE_CONNECTOR_SPI); + if (ret) + return ret; + + ret = drm_simple_display_pipe_init(drm, &epd->pipe, &repaper_pipe_funcs, + repaper_formats, ARRAY_SIZE(repaper_formats), + NULL, &epd->connector); if (ret) return ret; -- 2.20.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 10/10] drm/tinydrm: Move tinydrm_display_pipe_init() to mipi-dbi
tinydrm_display_pipe_init() has only one user now, so move it to mipi-dbi. Changes: - Remove drm_connector_helper_funcs.detect, it's always connected. - Store the connector and mode in mipi_dbi instead of it's own struct. Otherwise remove some leftover tinydrm-helpers.h inclusions. Cc: Eric Anholt Cc: David Lechner Signed-off-by: Noralf Trønnes --- Documentation/gpu/tinydrm.rst | 9 - drivers/gpu/drm/tinydrm/Makefile| 1 - drivers/gpu/drm/tinydrm/core/Makefile | 4 - drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 183 drivers/gpu/drm/tinydrm/hx8357d.c | 1 - drivers/gpu/drm/tinydrm/ili9341.c | 1 - drivers/gpu/drm/tinydrm/mi0283qt.c | 1 - drivers/gpu/drm/tinydrm/mipi-dbi.c | 87 +- drivers/gpu/drm/tinydrm/st7735r.c | 1 - include/drm/tinydrm/mipi-dbi.h | 10 ++ include/drm/tinydrm/tinydrm-helpers.h | 27 --- 11 files changed, 91 insertions(+), 234 deletions(-) delete mode 100644 drivers/gpu/drm/tinydrm/core/Makefile delete mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c delete mode 100644 include/drm/tinydrm/tinydrm-helpers.h diff --git a/Documentation/gpu/tinydrm.rst b/Documentation/gpu/tinydrm.rst index 2c2860fa1510..64bdf6356024 100644 --- a/Documentation/gpu/tinydrm.rst +++ b/Documentation/gpu/tinydrm.rst @@ -5,15 +5,6 @@ drm/tinydrm Tiny DRM drivers tinydrm is a collection of DRM drivers that are so small they can fit in a single source file. -Helpers -=== - -.. kernel-doc:: include/drm/tinydrm/tinydrm-helpers.h - :internal: - -.. kernel-doc:: drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c - :export: - MIPI DBI Compatible Controllers === diff --git a/drivers/gpu/drm/tinydrm/Makefile b/drivers/gpu/drm/tinydrm/Makefile index 48ec8ed9dc16..ab6b9bebf321 100644 --- a/drivers/gpu/drm/tinydrm/Makefile +++ b/drivers/gpu/drm/tinydrm/Makefile @@ -1,5 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_DRM_TINYDRM) += core/ # Controllers obj-$(CONFIG_TINYDRM_MIPI_DBI) += mipi-dbi.o diff --git a/drivers/gpu/drm/tinydrm/core/Makefile b/drivers/gpu/drm/tinydrm/core/Makefile deleted file mode 100644 index 78e179127e55.. --- a/drivers/gpu/drm/tinydrm/core/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -tinydrm-y := tinydrm-pipe.o - -obj-$(CONFIG_DRM_TINYDRM) += tinydrm.o diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c deleted file mode 100644 index a62d1dfe87f8.. --- a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c +++ /dev/null @@ -1,183 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (C) 2016 Noralf Trønnes - */ - -#include - -#include -#include -#include -#include -#include -#include -#include - -struct tinydrm_connector { - struct drm_connector base; - struct drm_display_mode mode; -}; - -static inline struct tinydrm_connector * -to_tinydrm_connector(struct drm_connector *connector) -{ - return container_of(connector, struct tinydrm_connector, base); -} - -static int tinydrm_connector_get_modes(struct drm_connector *connector) -{ - struct tinydrm_connector *tconn = to_tinydrm_connector(connector); - struct drm_display_mode *mode; - - mode = drm_mode_duplicate(connector->dev, &tconn->mode); - if (!mode) { - DRM_ERROR("Failed to duplicate mode\n"); - return 0; - } - - if (mode->name[0] == '\0') - drm_mode_set_name(mode); - - mode->type |= DRM_MODE_TYPE_PREFERRED; - drm_mode_probed_add(connector, mode); - - if (mode->width_mm) { - connector->display_info.width_mm = mode->width_mm; - connector->display_info.height_mm = mode->height_mm; - } - - return 1; -} - -static const struct drm_connector_helper_funcs tinydrm_connector_hfuncs = { - .get_modes = tinydrm_connector_get_modes, -}; - -static enum drm_connector_status -tinydrm_connector_detect(struct drm_connector *connector, bool force) -{ - if (drm_dev_is_unplugged(connector->dev)) - return connector_status_disconnected; - - return connector->status; -} - -static void tinydrm_connector_destroy(struct drm_connector *connector) -{ - struct tinydrm_connector *tconn = to_tinydrm_connector(connector); - - drm_connector_cleanup(connector); - kfree(tconn); -} - -static const struct drm_connector_funcs tinydrm_connector_funcs = { - .reset = drm_atomic_helper_connector_reset, - .detect = tinydrm_connector_detect, - .fill_modes = drm_helper_probe_single_connector_modes, - .destroy = tinydrm_connector_destroy, - .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, - .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, -}; - -struct dr
[PATCH 01/10] drm: Add SPI connector type
tinydrm drivers announce DRM_MODE_CONNECTOR_VIRTUAL for its SPI drivers. Stop lying and add a SPI connector type Cc: David Lechner Signed-off-by: Noralf Trønnes --- drivers/gpu/drm/drm_connector.c| 1 + drivers/gpu/drm/tinydrm/mipi-dbi.c | 3 +-- drivers/gpu/drm/tinydrm/repaper.c | 2 +- drivers/gpu/drm/tinydrm/st7586.c | 2 +- include/uapi/drm/drm_mode.h| 1 + 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 068d4b05f1be..cbb548b3708f 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -92,6 +92,7 @@ static struct drm_conn_prop_enum_list drm_connector_enum_list[] = { { DRM_MODE_CONNECTOR_DSI, "DSI" }, { DRM_MODE_CONNECTOR_DPI, "DPI" }, { DRM_MODE_CONNECTOR_WRITEBACK, "Writeback" }, + { DRM_MODE_CONNECTOR_SPI, "SPI" }, }; void drm_connector_ida_init(void) diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index ca9da654fc6f..791a0b43beef 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -445,9 +445,8 @@ int mipi_dbi_init(struct mipi_dbi *mipi, if (!mipi->tx_buf) return -ENOMEM; - /* TODO: Maybe add DRM_MODE_CONNECTOR_SPI */ ret = tinydrm_display_pipe_init(drm, &mipi->pipe, funcs, - DRM_MODE_CONNECTOR_VIRTUAL, + DRM_MODE_CONNECTOR_SPI, mipi_dbi_formats, ARRAY_SIZE(mipi_dbi_formats), mode, rotation); diff --git a/drivers/gpu/drm/tinydrm/repaper.c b/drivers/gpu/drm/tinydrm/repaper.c index 85acfccefcdb..40afa66107e5 100644 --- a/drivers/gpu/drm/tinydrm/repaper.c +++ b/drivers/gpu/drm/tinydrm/repaper.c @@ -1110,7 +1110,7 @@ static int repaper_probe(struct spi_device *spi) return -ENOMEM; ret = tinydrm_display_pipe_init(drm, &epd->pipe, &repaper_pipe_funcs, - DRM_MODE_CONNECTOR_VIRTUAL, + DRM_MODE_CONNECTOR_SPI, repaper_formats, ARRAY_SIZE(repaper_formats), mode, 0); if (ret) diff --git a/drivers/gpu/drm/tinydrm/st7586.c b/drivers/gpu/drm/tinydrm/st7586.c index 204face7b311..7ae39004aa88 100644 --- a/drivers/gpu/drm/tinydrm/st7586.c +++ b/drivers/gpu/drm/tinydrm/st7586.c @@ -384,7 +384,7 @@ static int st7586_probe(struct spi_device *spi) mipi->swap_bytes = true; ret = tinydrm_display_pipe_init(drm, &mipi->pipe, &st7586_pipe_funcs, - DRM_MODE_CONNECTOR_VIRTUAL, + DRM_MODE_CONNECTOR_SPI, st7586_formats, ARRAY_SIZE(st7586_formats), &st7586_mode, rotation); if (ret) diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 5ab331e5dc23..735c8cfdaaa1 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -361,6 +361,7 @@ enum drm_mode_subconnector { #define DRM_MODE_CONNECTOR_DSI 16 #define DRM_MODE_CONNECTOR_DPI 17 #define DRM_MODE_CONNECTOR_WRITEBACK 18 +#define DRM_MODE_CONNECTOR_SPI 19 struct drm_mode_get_connector { -- 2.20.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 04/10] drm/tinydrm: Remove tinydrm_spi_max_transfer_size()
spi-bcm2835 can handle >64kB buffers now so there is no need to check ->max_dma_len. The tinydrm_spi_max_transfer_size() max_len argument is not used by any callers, so not needed. Then we have the spi_max module parameter. It was added because staging/fbtft has support for it and there was a report that someone used it to set a small buffer size to avoid popping on a USB soundcard on a Raspberry Pi. In hindsight it shouldn't have been added, I should have waited for it to become a problem first. I don't know it anyone is actually using it, but since tinydrm_spi_transfer() is being moved to mipi-dbi, I'm taking the opportunity to remove it. I'll add it back to mipi-dbi if someone complains. With that out of the way, spi_max_transfer_size() can be used instead. The chosen 16kB buffer size for Type C Option 1 (9-bit) interface is somewhat arbitrary, but a bigger buffer will have a miniscule impact on transfer speed, so it's probably fine. Signed-off-by: Noralf Trønnes --- .../gpu/drm/tinydrm/core/tinydrm-helpers.c| 37 +-- drivers/gpu/drm/tinydrm/mipi-dbi.c| 10 + include/drm/tinydrm/tinydrm-helpers.h | 1 - 3 files changed, 3 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c index 272616a246cd..af5bec8861de 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c @@ -18,41 +18,8 @@ #include #include -static unsigned int spi_max; -module_param(spi_max, uint, 0400); -MODULE_PARM_DESC(spi_max, "Set a lower SPI max transfer size"); - #if IS_ENABLED(CONFIG_SPI) -/** - * tinydrm_spi_max_transfer_size - Determine max SPI transfer size - * @spi: SPI device - * @max_len: Maximum buffer size needed (optional) - * - * This function returns the maximum size to use for SPI transfers. It checks - * the SPI master, the optional @max_len and the module parameter spi_max and - * returns the smallest. - * - * Returns: - * Maximum size for SPI transfers - */ -size_t tinydrm_spi_max_transfer_size(struct spi_device *spi, size_t max_len) -{ - size_t ret; - - ret = min(spi_max_transfer_size(spi), spi->master->max_dma_len); - if (max_len) - ret = min(ret, max_len); - if (spi_max) - ret = min_t(size_t, ret, spi_max); - ret &= ~0x3; - if (ret < 4) - ret = 4; - - return ret; -} -EXPORT_SYMBOL(tinydrm_spi_max_transfer_size); - /** * tinydrm_spi_transfer - SPI transfer helper * @spi: SPI device @@ -75,21 +42,19 @@ int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, struct spi_transfer *header, u8 bpw, const void *buf, size_t len) { + size_t max_chunk = spi_max_transfer_size(spi); struct spi_transfer tr = { .bits_per_word = bpw, .speed_hz = speed_hz, }; struct spi_message m; u16 *swap_buf = NULL; - size_t max_chunk; size_t chunk; int ret = 0; if (WARN_ON_ONCE(bpw != 8 && bpw != 16)) return -EINVAL; - max_chunk = tinydrm_spi_max_transfer_size(spi, 0); - if (bpw == 16 && !spi_is_bpw_supported(spi, 16)) { tr.bits_per_word = 8; if (tinydrm_machine_little_endian()) { diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 99509d16b037..ae31a5c9aa1b 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -964,15 +964,9 @@ static int mipi_dbi_typec3_command(struct mipi_dbi *mipi, u8 *cmd, int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, struct gpio_desc *dc) { - size_t tx_size = tinydrm_spi_max_transfer_size(spi, 0); struct device *dev = &spi->dev; int ret; - if (tx_size < 16) { - DRM_ERROR("SPI transmit buffer too small: %zu\n", tx_size); - return -EINVAL; - } - /* * Even though it's not the SPI device that does DMA (the master does), * the dma mask is necessary for the dma_alloc_wc() in @@ -1001,8 +995,8 @@ int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, mipi->swap_bytes = true; } else { mipi->command = mipi_dbi_typec1_command; - mipi->tx_buf9_len = tx_size; - mipi->tx_buf9 = devm_kmalloc(dev, tx_size, GFP_KERNEL); + mipi->tx_buf9_len = SZ_16K; + mipi->tx_buf9 = devm_kmalloc(dev, mipi->tx_buf9_len, GFP_KERNEL); if (!mipi->tx_buf9) return -ENOMEM; } diff --git a/include/drm/tinydrm/tinydrm-helpers.h b/include/drm/tinydrm/tinydrm-helpers.h index dca75de3a359..10b35375a009 100644 --- a/include/drm/tinydrm/tinydrm-helpers.h +++ b/include/drm/tinydrm/tiny
[PATCH 06/10] drm/tinydrm: Move tinydrm_spi_transfer()
This is only used by mipi-dbi drivers so move it there. The reason this isn't moved to the SPI subsystem is that it will in a later patch pass a dummy rx buffer for SPI controllers that need this. Low memory boards (64MB) can run into a problem allocating such a "large" contiguous buffer on every transfer after a long up time. This leaves a very specific use case, so we'll keep the function here. mipi-dbi will first go through a refactoring though, before this will be done. Remove SPI todo entry now that we're done with the tinydrm.ko SPI code. Additionally move the mipi_dbi_spi_init() declaration to the other SPI functions. Cc: David Lechner Signed-off-by: Noralf Trønnes --- Documentation/gpu/tinydrm.rst | 3 - Documentation/gpu/todo.rst| 3 - drivers/gpu/drm/tinydrm/core/Makefile | 2 +- .../gpu/drm/tinydrm/core/tinydrm-helpers.c| 70 --- drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 4 ++ drivers/gpu/drm/tinydrm/ili9225.c | 5 +- drivers/gpu/drm/tinydrm/mipi-dbi.c| 49 - include/drm/tinydrm/mipi-dbi.h| 7 +- include/drm/tinydrm/tinydrm-helpers.h | 5 -- 9 files changed, 59 insertions(+), 89 deletions(-) delete mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c diff --git a/Documentation/gpu/tinydrm.rst b/Documentation/gpu/tinydrm.rst index 33a41544f659..2c2860fa1510 100644 --- a/Documentation/gpu/tinydrm.rst +++ b/Documentation/gpu/tinydrm.rst @@ -11,9 +11,6 @@ Helpers .. kernel-doc:: include/drm/tinydrm/tinydrm-helpers.h :internal: -.. kernel-doc:: drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c - :export: - .. kernel-doc:: drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c :export: diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 3f6ecf846263..384199325304 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -456,9 +456,6 @@ tinydrm Tinydrm is the helper driver for really simple fb drivers. The goal is to make those drivers as simple as possible, so lots of room for refactoring: -- spi helpers, probably best put into spi core/helper code. Thierry said - the spi maintainer is fast&reactive, so shouldn't be a big issue. - - extract the mipi-dbi helper (well, the non-tinydrm specific parts at least) into a separate helper, like we have for mipi-dsi already. Or follow one of the ideas for having a shared dsi/dbi helper, abstracting away the diff --git a/drivers/gpu/drm/tinydrm/core/Makefile b/drivers/gpu/drm/tinydrm/core/Makefile index 01065e920aea..78e179127e55 100644 --- a/drivers/gpu/drm/tinydrm/core/Makefile +++ b/drivers/gpu/drm/tinydrm/core/Makefile @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -tinydrm-y := tinydrm-pipe.o tinydrm-helpers.o +tinydrm-y := tinydrm-pipe.o obj-$(CONFIG_DRM_TINYDRM) += tinydrm.o diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c b/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c deleted file mode 100644 index d95eb50fa9d4.. --- a/drivers/gpu/drm/tinydrm/core/tinydrm-helpers.c +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * Copyright (C) 2016 Noralf Trønnes - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#if IS_ENABLED(CONFIG_SPI) - -/** - * tinydrm_spi_transfer - SPI transfer helper - * @spi: SPI device - * @speed_hz: Override speed (optional) - * @bpw: Bits per word - * @buf: Buffer to transfer - * @len: Buffer length - * - * This SPI transfer helper breaks up the transfer of @buf into chunks which - * the SPI controller driver can handle. - * - * Returns: - * Zero on success, negative error code on failure. - */ -int tinydrm_spi_transfer(struct spi_device *spi, u32 speed_hz, -u8 bpw, const void *buf, size_t len) -{ - size_t max_chunk = spi_max_transfer_size(spi); - struct spi_transfer tr = { - .bits_per_word = bpw, - .speed_hz = speed_hz, - }; - struct spi_message m; - size_t chunk; - int ret; - - spi_message_init_with_transfers(&m, &tr, 1); - - while (len) { - chunk = min(len, max_chunk); - - tr.tx_buf = buf; - tr.len = chunk; - buf += chunk; - len -= chunk; - - ret = spi_sync(spi, &m); - if (ret) - return ret; - } - - return 0; -} -EXPORT_SYMBOL(tinydrm_spi_transfer); - -#endif /* CONFIG_SPI */ - -MODULE_LICENSE("GPL"); diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c index ed798fd95152..a62d1dfe87f8 100644 --- a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c +++ b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c @@ -3,6 +3,8 @@ * Copyright (C) 2016 Noralf Trønnes */ +#include + #include #incl
Re: next/master boot: 265 boots: 17 failed, 243 passed with 4 offline, 1 conflict (next-20190717)
On Wed, Jul 17, 2019 at 04:27:56AM -0700, kernelci.org bot wrote: Today's -next fails to boot on a couple of apq8064 boards: > arm: > qcom_defconfig: > gcc-8: > qcom-apq8064-cm-qs600: 1 failed lab > qcom-apq8064-ifc6410: 1 failed lab In both cases it looks like the error handling when we fail to get the firmware for the GPU is broken, we get a crash in the initialization code shortly after failing to load some firmware: [4.608279] msm 510.mdp: Direct firmware load for qcom/a300_pm4.fw failed with error -2 [4.614916] msm 510.mdp: [drm:adreno_request_fw] *ERROR* failed to load a300_pm4.fw [4.623229] 8<--- cut here --- [4.63] Unable to handle kernel NULL pointer dereference at virtual address 0088 ... [4.665947] Workqueue: events deferred_probe_work_func [4.670532] PC is at msm_open+0x64/0x90 [4.675656] LR is at _raw_write_unlock+0x20/0x4c ... [4.949553] [] (msm_open) from [] (drm_file_alloc+0x134/0x21c) [4.957703] [] (drm_file_alloc) from [] (drm_client_init+0xa8/0x124) [4.965162] [] (drm_client_init) from [] (drm_fb_helper_init.part.0+0x30/0x3c) [4.973411] [] (drm_fb_helper_init.part.0) from [] (msm_fbdev_init+0x50/0xb4) [4.982173] [] (msm_fbdev_init) from [] (msm_drm_bind+0x560/0x638) Full details (including full boot logs) at: https://kernelci.org/boot/id/5d2ede2359b514a54b49e91b/ https://kernelci.org/boot/id/5d2ede2759b514a54749e91d/ signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 05/10] drm/tinydrm: Clean up tinydrm_spi_transfer()
On Wed, Jul 17, 2019 at 01:58:12PM +0200, Noralf Trønnes wrote: > Prep work before moving the function to mipi-dbi. > > tinydrm_spi_transfer() was made to support one class of drivers in > drivers/staging/fbtft that has not been converted to DRM yet, so strip > away the unused functionality: > - Start byte (header) is not used. > - No driver relies on the automatic 16-bit byte swapping on little endian > machines with SPI controllers only supporting 8 bits per word. Keeping unused code around is never a good idea. On the other hand, should we not try to get the driver in questions ported so we have a user and we do not need to re-add this later? What driver/display needs this? Sam ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/10] drm/tinydrm: Move tinydrm_spi_transfer()
Hi Noralf. On Wed, Jul 17, 2019 at 01:58:13PM +0200, Noralf Trønnes wrote: > This is only used by mipi-dbi drivers so move it there. > > The reason this isn't moved to the SPI subsystem is that it will in a > later patch pass a dummy rx buffer for SPI controllers that need this. > Low memory boards (64MB) can run into a problem allocating such a "large" > contiguous buffer on every transfer after a long up time. > This leaves a very specific use case, so we'll keep the function here. > mipi-dbi will first go through a refactoring though, before this will > be done. > > Remove SPI todo entry now that we're done with the tinydrm.ko SPI code. > > Additionally move the mipi_dbi_spi_init() declaration to the other SPI > functions. > > Cc: David Lechner > Signed-off-by: Noralf Trønnes With the few nitpics considered: Reviewed-by: Sam Ravnborg > diff --git a/include/drm/tinydrm/mipi-dbi.h b/include/drm/tinydrm/mipi-dbi.h > index 51fc667beef7..576e9a7349ab 100644 > --- a/include/drm/tinydrm/mipi-dbi.h > +++ b/include/drm/tinydrm/mipi-dbi.h > @@ -67,8 +67,6 @@ static inline struct mipi_dbi *drm_to_mipi_dbi(struct > drm_device *drm) > return container_of(drm, struct mipi_dbi, drm); > } > > -int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, > - struct gpio_desc *dc); Moving this prototype looks like it belongs in another patch? Sam ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 111161] Gmail>>Compose>>Clicking on Attachment file throws error
https://bugs.freedesktop.org/show_bug.cgi?id=61 nareshrajus...@gmail.com changed: What|Removed |Added Status|NEW |ASSIGNED -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 111161] Gmail>>Compose>>Clicking on Attachment file throws error
https://bugs.freedesktop.org/show_bug.cgi?id=61 nareshrajus...@gmail.com changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 111161] Gmail>>Compose>>Clicking on Attachment file throws error
https://bugs.freedesktop.org/show_bug.cgi?id=61 nareshrajus...@gmail.com changed: What|Removed |Added Status|RESOLVED|VERIFIED -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 111161] Gmail>>Compose>>Clicking on Attachment file throws error
https://bugs.freedesktop.org/show_bug.cgi?id=61 nareshrajus...@gmail.com changed: What|Removed |Added Status|VERIFIED|CLOSED -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 00/10] drm/tinydrm: Remove tinydrm.ko
Hi Noralf. Nice series of patches! On Wed, Jul 17, 2019 at 01:58:07PM +0200, Noralf Trønnes wrote: > This series removes the remaining bits of tinydrm.ko. > > There's only one item left on the tinydrm todo list and that is moving > out mipi_dbi. > > Note: > This depends on a commit that just entered Linus' tree: > e6f3f7e4dc76 ("spi: Add spi_is_bpw_supported()") > > Series is also available here: > https://github.com/notro/linux/tree/remove_tinydrm_ko > > Noralf. > > Noralf Trønnes (10): > drm: Add SPI connector type > drm/tinydrm: Use spi_is_bpw_supported() > drm/tinydrm: Remove spi debug buffer dumping > drm/tinydrm: Remove tinydrm_spi_max_transfer_size() > drm/tinydrm: Clean up tinydrm_spi_transfer() > drm/tinydrm: Move tinydrm_spi_transfer() > drm/tinydrm: Move tinydrm_machine_little_endian() > drm/tinydrm/repaper: Don't use tinydrm_display_pipe_init() > drm/tinydrm/mipi-dbi: Add mipi_dbi_init_with_formats() > drm/tinydrm: Move tinydrm_display_pipe_init() to mipi-dbi > Patch 1-3, 7, 8, 9 are: Reviewed-by: Sam Ravnborg Patch 4 are: Acked-by: Sam Ravnborg (Did not feel I had enough background to say r-b). Individual comments sent for the other patches. Sam ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 10/10] drm/tinydrm: Move tinydrm_display_pipe_init() to mipi-dbi
On Wed, Jul 17, 2019 at 01:58:17PM +0200, Noralf Trønnes wrote: > tinydrm_display_pipe_init() has only one user now, so move it to mipi-dbi. > > Changes: > - Remove drm_connector_helper_funcs.detect, it's always connected. > - Store the connector and mode in mipi_dbi instead of it's own struct. > > Otherwise remove some leftover tinydrm-helpers.h inclusions. For review purposes it would have been easier had this been split in a few more patches. But anyway, I think I managed to follow all changes. So it has my: Reviewed-by: Sam Ravnborg > > Cc: Eric Anholt > Cc: David Lechner > Signed-off-by: Noralf Trønnes > --- > Documentation/gpu/tinydrm.rst | 9 - > drivers/gpu/drm/tinydrm/Makefile| 1 - > drivers/gpu/drm/tinydrm/core/Makefile | 4 - > drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c | 183 > drivers/gpu/drm/tinydrm/hx8357d.c | 1 - > drivers/gpu/drm/tinydrm/ili9341.c | 1 - > drivers/gpu/drm/tinydrm/mi0283qt.c | 1 - > drivers/gpu/drm/tinydrm/mipi-dbi.c | 87 +- > drivers/gpu/drm/tinydrm/st7735r.c | 1 - > include/drm/tinydrm/mipi-dbi.h | 10 ++ > include/drm/tinydrm/tinydrm-helpers.h | 27 --- > 11 files changed, 91 insertions(+), 234 deletions(-) > delete mode 100644 drivers/gpu/drm/tinydrm/core/Makefile > delete mode 100644 drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c > delete mode 100644 include/drm/tinydrm/tinydrm-helpers.h > > diff --git a/Documentation/gpu/tinydrm.rst b/Documentation/gpu/tinydrm.rst > index 2c2860fa1510..64bdf6356024 100644 > --- a/Documentation/gpu/tinydrm.rst > +++ b/Documentation/gpu/tinydrm.rst > @@ -5,15 +5,6 @@ drm/tinydrm Tiny DRM drivers > tinydrm is a collection of DRM drivers that are so small they can fit in a > single source file. > > -Helpers > -=== > - > -.. kernel-doc:: include/drm/tinydrm/tinydrm-helpers.h > - :internal: > - > -.. kernel-doc:: drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c > - :export: > - > MIPI DBI Compatible Controllers > === > > diff --git a/drivers/gpu/drm/tinydrm/Makefile > b/drivers/gpu/drm/tinydrm/Makefile > index 48ec8ed9dc16..ab6b9bebf321 100644 > --- a/drivers/gpu/drm/tinydrm/Makefile > +++ b/drivers/gpu/drm/tinydrm/Makefile > @@ -1,5 +1,4 @@ > # SPDX-License-Identifier: GPL-2.0-only > -obj-$(CONFIG_DRM_TINYDRM)+= core/ > > # Controllers > obj-$(CONFIG_TINYDRM_MIPI_DBI) += mipi-dbi.o > diff --git a/drivers/gpu/drm/tinydrm/core/Makefile > b/drivers/gpu/drm/tinydrm/core/Makefile > deleted file mode 100644 > index 78e179127e55.. > --- a/drivers/gpu/drm/tinydrm/core/Makefile > +++ /dev/null > @@ -1,4 +0,0 @@ > -# SPDX-License-Identifier: GPL-2.0-only > -tinydrm-y := tinydrm-pipe.o > - > -obj-$(CONFIG_DRM_TINYDRM) += tinydrm.o > diff --git a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c > b/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c > deleted file mode 100644 > index a62d1dfe87f8.. > --- a/drivers/gpu/drm/tinydrm/core/tinydrm-pipe.c > +++ /dev/null > @@ -1,183 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0-or-later > -/* > - * Copyright (C) 2016 Noralf Trønnes > - */ > - > -#include > - > -#include > -#include > -#include > -#include > -#include > -#include > -#include > - > -struct tinydrm_connector { > - struct drm_connector base; > - struct drm_display_mode mode; > -}; > - > -static inline struct tinydrm_connector * > -to_tinydrm_connector(struct drm_connector *connector) > -{ > - return container_of(connector, struct tinydrm_connector, base); > -} > - > -static int tinydrm_connector_get_modes(struct drm_connector *connector) > -{ > - struct tinydrm_connector *tconn = to_tinydrm_connector(connector); > - struct drm_display_mode *mode; > - > - mode = drm_mode_duplicate(connector->dev, &tconn->mode); > - if (!mode) { > - DRM_ERROR("Failed to duplicate mode\n"); > - return 0; > - } > - > - if (mode->name[0] == '\0') > - drm_mode_set_name(mode); > - > - mode->type |= DRM_MODE_TYPE_PREFERRED; > - drm_mode_probed_add(connector, mode); > - > - if (mode->width_mm) { > - connector->display_info.width_mm = mode->width_mm; > - connector->display_info.height_mm = mode->height_mm; > - } > - > - return 1; > -} > - > -static const struct drm_connector_helper_funcs tinydrm_connector_hfuncs = { > - .get_modes = tinydrm_connector_get_modes, > -}; > - > -static enum drm_connector_status > -tinydrm_connector_detect(struct drm_connector *connector, bool force) > -{ > - if (drm_dev_is_unplugged(connector->dev)) > - return connector_status_disconnected; > - > - return connector->status; > -} > - > -static void tinydrm_connector_destroy(struct drm_connector *connector) > -{ > - struct tinydrm_connector *tconn = to_tinydrm_connector(connector); > - > - drm_conne
kernel panic: stack is corrupted in pointer
Hello, syzbot found the following crash on: HEAD commit:1438cde7 Add linux-next specific files for 20190716 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=1398805860 kernel config: https://syzkaller.appspot.com/x/.config?x=3430a151e1452331 dashboard link: https://syzkaller.appspot.com/bug?extid=79f5f028005a77ecb6bb compiler: gcc (GCC) 9.0.0 20181231 (experimental) syz repro: https://syzkaller.appspot.com/x/repro.syz?x=111fc8afa0 The bug was bisected to: commit 96a5d8d4915f3e241ebb48d5decdd110ab9c7dcf Author: Leo Liu Date: Fri Jul 13 15:26:28 2018 + drm/amdgpu: Make sure IB tests flushed after IP resume bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=14a4620060 final crash:https://syzkaller.appspot.com/x/report.txt?x=16a4620060 console output: https://syzkaller.appspot.com/x/log.txt?x=12a4620060 IMPORTANT: if you fix the bug, please add the following tag to the commit: Reported-by: syzbot+79f5f028005a77ecb...@syzkaller.appspotmail.com Fixes: 96a5d8d4915f ("drm/amdgpu: Make sure IB tests flushed after IP resume") Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: pointer+0x702/0x750 lib/vsprintf.c:2187 Shutting down cpus with NMI Kernel Offset: disabled --- This bug is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at syzkal...@googlegroups.com. syzbot will keep track of this bug report. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. For information about bisection process see: https://goo.gl/tpsmEJ#bisection syzbot can test patches for this bug, for details see: https://goo.gl/tpsmEJ#testing-patches ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v4 0/4] Add a generic driver for LED-based backlight
This series aims to add a led-backlight driver, similar to pwm-backlight, but using a LED class device underneath. A few years ago (2015), Tomi Valkeinen posted a series implementing a backlight driver on top of a LED device: https://patchwork.kernel.org/patch/7293991/ https://patchwork.kernel.org/patch/7294001/ https://patchwork.kernel.org/patch/7293981/ The discussion stopped because Tomi lacked the time to work on it. changes in v4: - fix dev_err() messages and commit logs following the advices of Pavel - cosmetic changes (indents, getting rid of "? 1 : 0" in led_match_led_node()) changes in v3: - dt binding: don't limit the brightness range to 0-255. Use the range of the underlying LEDs. as a side-effect, all LEDs must now have the same range - driver: Adapt to dt binding update. - driver: rework probe() for clarity and remove the remaining goto. changes in v2: - handle more than one LED. - don't make the backlight device a child of the LED controller. - make brightness-levels and default-brightness-level optional - removed the option to use a GPIO enable. - removed the option to use a regulator. It should be handled by the LED core - don't make any change to the LED core (not needed anymore) Jean-Jacques Hiblot (2): leds: Add managed API to get a LED from a device driver dt-bindings: backlight: Add led-backlight binding Tomi Valkeinen (2): leds: Add of_led_get() and led_put() backlight: add led-backlight driver .../bindings/leds/backlight/led-backlight.txt | 28 ++ drivers/leds/led-class.c | 92 ++ drivers/video/backlight/Kconfig | 7 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/led_bl.c | 268 ++ include/linux/leds.h | 6 + 6 files changed, 402 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/backlight/led-backlight.txt create mode 100644 drivers/video/backlight/led_bl.c -- 2.17.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v4 2/4] leds: Add managed API to get a LED from a device driver
If the LED is acquired by a consumer device with devm_led_get(), it is automatically released when the device is detached. Signed-off-by: Jean-Jacques Hiblot Acked-by: Pavel Machek --- drivers/leds/led-class.c | 42 include/linux/leds.h | 2 ++ 2 files changed, 44 insertions(+) diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index 9f48798a713d..714b55f1da0f 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -263,6 +263,48 @@ void led_put(struct led_classdev *led_cdev) } EXPORT_SYMBOL_GPL(led_put); +static void devm_led_release(struct device *dev, void *res) +{ + struct led_classdev **p = res; + + led_put(*p); +} + +/** + * devm_led_get - Resource-managed request of a LED device + * @dev: LED consumer + * @idx: index of the LED to obtain in the consumer + * + * The device node of the device is parse to find the request LED device. + * The LED device returned from this function is automatically released + * on driver detach. + * + * @return a pointer to a LED device or ERR_PTR(errno) on failure. + */ +struct led_classdev *__must_check devm_led_get(struct device *dev, + int index) +{ + struct led_classdev *led; + struct led_classdev **dr; + + led = of_led_get(dev->of_node, index); + if (IS_ERR(led)) + return led; + + dr = devres_alloc(devm_led_release, sizeof(struct led_classdev *), + GFP_KERNEL); + if (!dr) { + led_put(led); + return ERR_PTR(-ENOMEM); + } + + *dr = led; + devres_add(dev, dr); + + return led; +} +EXPORT_SYMBOL_GPL(devm_led_get); + static int match_name(struct device *dev, const void *data) { if (!dev_name(dev)) diff --git a/include/linux/leds.h b/include/linux/leds.h index 0a71c7cdd191..7fcec566d774 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -148,6 +148,8 @@ extern void led_classdev_resume(struct led_classdev *led_cdev); extern struct led_classdev *of_led_get(struct device_node *np, int index); extern void led_put(struct led_classdev *led_cdev); +struct led_classdev *__must_check devm_led_get(struct device *dev, + int index); /** * led_blink_set - set blinking with software fallback -- 2.17.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v4 4/4] backlight: add led-backlight driver
From: Tomi Valkeinen This patch adds a led-backlight driver (led_bl), which is similar to pwm_bl except the driver uses a LED class driver to adjust the brightness in the HW. Multiple LEDs can be used for a single backlight. Signed-off-by: Tomi Valkeinen Signed-off-by: Jean-Jacques Hiblot Acked-by: Pavel Machek --- drivers/video/backlight/Kconfig | 7 + drivers/video/backlight/Makefile | 1 + drivers/video/backlight/led_bl.c | 268 +++ 3 files changed, 276 insertions(+) create mode 100644 drivers/video/backlight/led_bl.c diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 8b081d61773e..585a1787618c 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -458,6 +458,13 @@ config BACKLIGHT_RAVE_SP help Support for backlight control on RAVE SP device. +config BACKLIGHT_LED + tristate "Generic LED based Backlight Driver" + depends on LEDS_CLASS && OF + help + If you have a LCD backlight adjustable by LED class driver, say Y + to enable this driver. + endif # BACKLIGHT_CLASS_DEVICE endmenu diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index 63c507c07437..2a67642966a5 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -57,3 +57,4 @@ obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o obj-$(CONFIG_BACKLIGHT_ARCXCNN)+= arcxcnn_bl.o obj-$(CONFIG_BACKLIGHT_RAVE_SP)+= rave-sp-backlight.o +obj-$(CONFIG_BACKLIGHT_LED)+= led_bl.o diff --git a/drivers/video/backlight/led_bl.c b/drivers/video/backlight/led_bl.c new file mode 100644 index ..ac5ff78e7859 --- /dev/null +++ b/drivers/video/backlight/led_bl.c @@ -0,0 +1,268 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2015-2019 Texas Instruments Incorporated - http://www.ti.com/ + * Author: Tomi Valkeinen + * + * Based on pwm_bl.c + */ + +#include +#include +#include +#include +#include +#include + +#define BKL_FULL_BRIGHTNESS 255 + +struct led_bl_data { + struct device *dev; + struct backlight_device *bl_dev; + struct led_classdev **leds; + boolenabled; + int nb_leds; + unsigned int*levels; + unsigned intdefault_brightness; + unsigned intmax_brightness; +}; + +static int to_led_brightness(struct led_classdev *led, int value) +{ + return (value * led->max_brightness) / BKL_FULL_BRIGHTNESS; +} + +static void led_bl_set_brightness(struct led_bl_data *priv, int level) +{ + int i; + int bkl_brightness; + + if (priv->levels) + bkl_brightness = priv->levels[level]; + else + bkl_brightness = level; + + for (i = 0; i < priv->nb_leds; i++) { + int led_brightness; + struct led_classdev *led = priv->leds[i]; + + led_brightness = to_led_brightness(led, bkl_brightness); + led_set_brightness(led, led_brightness); + } + + priv->enabled = true; +} + +static void led_bl_power_off(struct led_bl_data *priv) +{ + int i; + + if (!priv->enabled) + return; + + for (i = 0; i < priv->nb_leds; i++) + led_set_brightness(priv->leds[i], LED_OFF); + + priv->enabled = false; +} + +static int led_bl_update_status(struct backlight_device *bl) +{ + struct led_bl_data *priv = bl_get_data(bl); + int brightness = bl->props.brightness; + + if (bl->props.power != FB_BLANK_UNBLANK || + bl->props.fb_blank != FB_BLANK_UNBLANK || + bl->props.state & BL_CORE_FBBLANK) + brightness = 0; + + if (brightness > 0) + led_bl_set_brightness(priv, brightness); + else + led_bl_power_off(priv); + + return 0; +} + +static const struct backlight_ops led_bl_ops = { + .update_status = led_bl_update_status, +}; + +static int led_bl_get_leds(struct device *dev, + struct led_bl_data *priv) +{ + int i, nb_leds, ret; + struct device_node *node = dev->of_node; + struct led_classdev **leds; + unsigned int max_brightness; + unsigned int default_brightness; + + ret = of_count_phandle_with_args(node, "leds", NULL); + if (ret < 0) { + dev_err(dev, "Unable to get led count\n"); + return -EINVAL; + } + + nb_leds = ret; + if (nb_leds < 1) { + dev_err(dev, "At least one LED must be specified!\n"); + return -EINVAL; + } + + leds = devm_kzalloc(dev, sizeof(struct led_classdev *) * nb_leds, + GFP_KERNEL); + if (!leds) + return -ENOMEM; + + for (i = 0; i < nb_leds; i++) { +
[PATCH v4 3/4] dt-bindings: backlight: Add led-backlight binding
Add DT binding for led-backlight. Signed-off-by: Jean-Jacques Hiblot --- .../bindings/leds/backlight/led-backlight.txt | 28 +++ 1 file changed, 28 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/backlight/led-backlight.txt diff --git a/Documentation/devicetree/bindings/leds/backlight/led-backlight.txt b/Documentation/devicetree/bindings/leds/backlight/led-backlight.txt new file mode 100644 index ..4c7dfbe7f67a --- /dev/null +++ b/Documentation/devicetree/bindings/leds/backlight/led-backlight.txt @@ -0,0 +1,28 @@ +led-backlight bindings + +This binding is used to describe a basic backlight device made of LEDs. +It can also be used to describe a backlight device controlled by the output of +a LED driver. + +Required properties: + - compatible: "led-backlight" + - leds: a list of LEDs + +Optional properties: + - brightness-levels: Array of distinct brightness levels. The levels must be + in the range accepted by the underlying LED devices. + This is used to translate a backlight brightness level + into a LED brightness level. If it is not provided, the + identity mapping is used. + + - default-brightness-level: The default brightness level. + +Example: + + backlight { + compatible = "led-backlight"; + + leds = <&led1>, <&led2>; + brightness-levels = <0 4 8 16 32 64 128 255>; + default-brightness-level = <6>; + }; -- 2.17.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v4 1/4] leds: Add of_led_get() and led_put()
From: Tomi Valkeinen This patch adds basic support for a kernel driver to get a LED device. This will be used by the led-backlight driver. Only OF version is implemented for now, and the behavior is similar to PWM's of_pwm_get() and pwm_put(). Signed-off-by: Tomi Valkeinen Signed-off-by: Jean-Jacques Hiblot --- drivers/leds/led-class.c | 50 include/linux/leds.h | 4 2 files changed, 54 insertions(+) diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index cadd43c30d50..9f48798a713d 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "leds.h" static struct class *leds_class; @@ -213,6 +214,55 @@ static int led_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(leds_class_dev_pm_ops, led_suspend, led_resume); +static int led_match_led_node(struct device *led_dev, const void *data) +{ + return led_dev->of_node == data; +} + +/** + * of_led_get() - request a LED device via the LED framework + * @np: device node to get the LED device from + * @index: the index of the LED + * + * Returns the LED device parsed from the phandle specified in the "leds" + * property of a device tree node or a negative error-code on failure. + */ +struct led_classdev *of_led_get(struct device_node *np, int index) +{ + struct device *led_dev; + struct led_classdev *led_cdev; + struct device_node *led_node; + + led_node = of_parse_phandle(np, "leds", index); + if (!led_node) + return ERR_PTR(-ENOENT); + + led_dev = class_find_device(leds_class, NULL, led_node, + led_match_led_node); + of_node_put(led_node); + + if (!led_dev) + return ERR_PTR(-EPROBE_DEFER); + + led_cdev = dev_get_drvdata(led_dev); + + if (!try_module_get(led_cdev->dev->parent->driver->owner)) + return ERR_PTR(-ENODEV); + + return led_cdev; +} +EXPORT_SYMBOL_GPL(of_led_get); + +/** + * led_put() - release a LED device + * @led_cdev: LED device + */ +void led_put(struct led_classdev *led_cdev) +{ + module_put(led_cdev->dev->parent->driver->owner); +} +EXPORT_SYMBOL_GPL(led_put); + static int match_name(struct device *dev, const void *data) { if (!dev_name(dev)) diff --git a/include/linux/leds.h b/include/linux/leds.h index bee8e3f8..0a71c7cdd191 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -19,6 +19,7 @@ struct device; struct led_pattern; +struct device_node; /* * LED Core */ @@ -145,6 +146,9 @@ extern void devm_led_classdev_unregister(struct device *parent, extern void led_classdev_suspend(struct led_classdev *led_cdev); extern void led_classdev_resume(struct led_classdev *led_cdev); +extern struct led_classdev *of_led_get(struct device_node *np, int index); +extern void led_put(struct led_classdev *led_cdev); + /** * led_blink_set - set blinking with software fallback * @led_cdev: the LED to start blinking -- 2.17.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING in con_is_bound
Hello! Our CI on s390x constantly triggers the following warning in function con_is_bound() when reading the SysFS attribute /sys/class/vtconsole/vtcon0/bind. I verified this to be the case since WARN_CONSOLE_UNLOCKED() was introduced in function con_is_bound() with commit ddde3c18b700 ("vt: More locking checks"), which has recently been merged into Linus' master branch. >From CI with recent Linus' master branch built with >arch/s390/configs/defconfig. dump2tar is a utility we use to collect the whole >SysFS as tar archive for problem determination. WARNING: CPU: 7 PID: 47758 at drivers/tty/vt/vt.c:3825 con_is_bound+0x8e/0x98 Kernel panic - not syncing: panic_on_warn set ... CPU: 7 PID: 47758 Comm: dump2tar Tainted: G OE 5.3.0-20190715.rc0.git0.1d039859330b.301.fc30.s390x+git #1 Hardware name: IBM ... (z/VM 7.1.0) Call Trace: ([<291b7b46>] show_stack+0x8e/0xd0) [<29b82242>] dump_stack+0x7a/0xa8 [<291e9aea>] panic+0x112/0x308 [<291e991a>] __warn+0xc2/0x118 [<29b81312>] report_bug+0xfa/0x158 [<291a534c>] do_report_trap+0xc4/0xe0 [<291a5522>] illegal_op+0x13a/0x150 [<29ba2a1c>] pgm_check_handler+0x1c8/0x220 [<29877626>] con_is_bound+0x8e/0x98 ([<8fed2820>] 0x8fed2820) [<29878502>] show_bind+0x32/0x58 [<298f46f4>] dev_attr_show+0x2c/0x70 [<294d57ac>] sysfs_kf_seq_show+0xac/0x158 [<294565a0>] seq_read+0xe0/0x478 [<2942774c>] vfs_read+0x94/0x150 [<29427b10>] ksys_read+0x68/0xf8 [<29ba2624>] system_call+0xd8/0x2c8 >From verification with Kernel based on commit ddde3c18b700 ("vt: More locking >checks") built with arch/s390/configs/performance_defconfig. I used cat >/sys/class/vtconsole/vtcon0/bind to trigger the warning. WARNING: CPU: 0 PID: 923 at drivers/tty/vt/vt.c:3825 con_is_bound+0x8e/0x98 Modules linked in: ... CPU: 0 PID: 923 Comm: cat Not tainted 5.2.0-rc4-4-gddde3c18b700 #2 Hardware name: IBM 3906 M03 703 (z/VM 7.1.0) Krnl PSW : 0704c0018000 41418856 (con_is_bound+0x8e/0x98) R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 RI:0 EA:3 Krnl GPRS: 3d6a4000 41b3cd88 7aba3000 41493378 7b52b428 03e000abfef8 78dc6540 41bbe310 41bbbf10 7ac4a000 7b52b440 41418842 03e000abfca8 Krnl Code: 4141884c: 1612or %r1,%r2 4141884e: a774ffd5brc 7,414187f8 #41418852: a7f40001brc 15,41418854 >41418856: a7f4ffd1brc 15,414187f8 4141885a: 0707bcr 0,%r7 4141885c: 0707bcr 0,%r7 4141885e: 0707bcr 0,%r7 41418860: c004brcl0,41418860 Call Trace: ([<03e000abfca0>] 0x3e000abfca0) [<41419732>] show_bind+0x32/0x58 [<414933a8>] dev_attr_show+0x30/0x70 [<410798e8>] sysfs_kf_seq_show+0xb0/0x158 [<40ffa95c>] seq_read+0xe4/0x478 [<40fcbe84>] vfs_read+0x94/0x150 [<40fcc248>] ksys_read+0x68/0xf8 [<41733530>] system_call+0xdc/0x2c8 Last Breaking-Event-Address: [<41418852>] con_is_bound+0x8a/0x98 ---[ end trace 80e05e05ec2ee660 ]--- Thanks and regards, Jens Remus -- Linux on Z and z/VSE Development & Service (D3229) IBM Systems & Technology Group, Pure Systems & Modular Software Development IBM Data Privacy Statement: https://www.ibm.com/privacy/us/en/ IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Matthias Hartmann Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Boeblingen Registergericht: Amtsgericht Stuttgart, HRB 243294
[PATCH v2] Staging: fbtft: Fix GPIO handling
Commit c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface") breaks GPIO handling. In several places, checks to only set a GPIO if it was configured ended up backwards. I have tested this fix. The fixed driver works with a ili9486 display connected to a raspberry pi via SPI. Fixes: commit c440eee1a7a1d ("Staging: fbtft: Switch to the gpio descriptor interface") Tested-by: Jan Sebastian Götte Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Jan Sebastian Götte --- drivers/staging/fbtft/fb_bd663474.c | 2 +- drivers/staging/fbtft/fb_ili9163.c | 2 +- drivers/staging/fbtft/fb_ili9325.c | 2 +- drivers/staging/fbtft/fb_s6d1121.c | 2 +- drivers/staging/fbtft/fb_ssd1289.c | 2 +- drivers/staging/fbtft/fb_ssd1331.c | 4 ++-- drivers/staging/fbtft/fb_upd161704.c | 2 +- drivers/staging/fbtft/fbtft-bus.c| 2 +- drivers/staging/fbtft/fbtft-core.c | 4 ++-- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/fbtft/fb_bd663474.c b/drivers/staging/fbtft/fb_bd663474.c index b6c6d66e4eb1..e2c7646588f8 100644 --- a/drivers/staging/fbtft/fb_bd663474.c +++ b/drivers/staging/fbtft/fb_bd663474.c @@ -24,7 +24,7 @@ static int init_display(struct fbtft_par *par) { - if (!par->gpio.cs) + if (par->gpio.cs) gpiod_set_value(par->gpio.cs, 0); /* Activate chip */ par->fbtftops.reset(par); diff --git a/drivers/staging/fbtft/fb_ili9163.c b/drivers/staging/fbtft/fb_ili9163.c index d609a2b67db9..fd32376700e2 100644 --- a/drivers/staging/fbtft/fb_ili9163.c +++ b/drivers/staging/fbtft/fb_ili9163.c @@ -77,7 +77,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset(par); - if (!par->gpio.cs) + if (par->gpio.cs) gpiod_set_value(par->gpio.cs, 0); /* Activate chip */ write_reg(par, MIPI_DCS_SOFT_RESET); /* software reset */ diff --git a/drivers/staging/fbtft/fb_ili9325.c b/drivers/staging/fbtft/fb_ili9325.c index b090e7ab6fdd..85e54a10ed72 100644 --- a/drivers/staging/fbtft/fb_ili9325.c +++ b/drivers/staging/fbtft/fb_ili9325.c @@ -85,7 +85,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset(par); - if (!par->gpio.cs) + if (par->gpio.cs) gpiod_set_value(par->gpio.cs, 0); /* Activate chip */ bt &= 0x07; diff --git a/drivers/staging/fbtft/fb_s6d1121.c b/drivers/staging/fbtft/fb_s6d1121.c index b3d0701880fe..5a129b1352cc 100644 --- a/drivers/staging/fbtft/fb_s6d1121.c +++ b/drivers/staging/fbtft/fb_s6d1121.c @@ -29,7 +29,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset(par); - if (!par->gpio.cs) + if (par->gpio.cs) gpiod_set_value(par->gpio.cs, 0); /* Activate chip */ /* Initialization sequence from Lib_UTFT */ diff --git a/drivers/staging/fbtft/fb_ssd1289.c b/drivers/staging/fbtft/fb_ssd1289.c index bbf75f795234..88a5b6925901 100644 --- a/drivers/staging/fbtft/fb_ssd1289.c +++ b/drivers/staging/fbtft/fb_ssd1289.c @@ -28,7 +28,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset(par); - if (!par->gpio.cs) + if (par->gpio.cs) gpiod_set_value(par->gpio.cs, 0); /* Activate chip */ write_reg(par, 0x00, 0x0001); diff --git a/drivers/staging/fbtft/fb_ssd1331.c b/drivers/staging/fbtft/fb_ssd1331.c index 4cfe9f8535d0..37622c9462aa 100644 --- a/drivers/staging/fbtft/fb_ssd1331.c +++ b/drivers/staging/fbtft/fb_ssd1331.c @@ -81,7 +81,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...) va_start(args, len); *buf = (u8)va_arg(args, unsigned int); - if (!par->gpio.dc) + if (par->gpio.dc) gpiod_set_value(par->gpio.dc, 0); ret = par->fbtftops.write(par, par->buf, sizeof(u8)); if (ret < 0) { @@ -104,7 +104,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...) return; } } - if (!par->gpio.dc) + if (par->gpio.dc) gpiod_set_value(par->gpio.dc, 1); va_end(args); } diff --git a/drivers/staging/fbtft/fb_upd161704.c b/drivers/staging/fbtft/fb_upd161704.c index 564a38e34440..c77832ae5e5b 100644 --- a/drivers/staging/fbtft/fb_upd161704.c +++ b/drivers/staging/fbtft/fb_upd161704.c @@ -26,7 +26,7 @@ static int init_display(struct fbtft_par *par) { par->fbtftops.reset(par); - if (!par->gpio.cs) + if (par->gpio.cs) gpiod_set_value(par->gpio.cs, 0); /* Activate chip */ /* Initialization sequence from Lib_UTFT */ diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c index 2ea814d0dca5..63c65dd67b17 100644 --- a/drivers/staging/fbtft/fbtft-bus.c +++ b/drivers/staging/fbtft/fbtft-bus.c @@ -135,7 +135,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) remain = len / 2; vmem1
Re: [PATCH] staging: android: ion: Remove unused rbtree for ion_buffer
On 7/12/19 4:47 AM, Lecopzer Chen wrote: ion_buffer_add() insert ion_buffer into rbtree every time creating an ion_buffer but never use it after ION reworking. Also, buffer_lock protects only rbtree operation, remove it together. Signed-off-by: Lecopzer Chen Cc: YJ Chiang Cc: Lecopzer Chen --- drivers/staging/android/ion/ion.c | 36 --- drivers/staging/android/ion/ion.h | 10 + 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 92c2914239e3..e6b1ca141b93 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -29,32 +29,6 @@ static struct ion_device *internal_dev; static int heap_id; -/* this function should only be called while dev->lock is held */ -static void ion_buffer_add(struct ion_device *dev, - struct ion_buffer *buffer) -{ - struct rb_node **p = &dev->buffers.rb_node; - struct rb_node *parent = NULL; - struct ion_buffer *entry; - - while (*p) { - parent = *p; - entry = rb_entry(parent, struct ion_buffer, node); - - if (buffer < entry) { - p = &(*p)->rb_left; - } else if (buffer > entry) { - p = &(*p)->rb_right; - } else { - pr_err("%s: buffer already found.", __func__); - BUG(); - } - } - - rb_link_node(&buffer->node, parent, p); - rb_insert_color(&buffer->node, &dev->buffers); -} - /* this function should only be called while dev->lock is held */ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, struct ion_device *dev, @@ -100,9 +74,6 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap, INIT_LIST_HEAD(&buffer->attachments); mutex_init(&buffer->lock); - mutex_lock(&dev->buffer_lock); - ion_buffer_add(dev, buffer); - mutex_unlock(&dev->buffer_lock); return buffer; err1: @@ -131,11 +102,6 @@ void ion_buffer_destroy(struct ion_buffer *buffer) static void _ion_buffer_destroy(struct ion_buffer *buffer) { struct ion_heap *heap = buffer->heap; - struct ion_device *dev = buffer->dev; - - mutex_lock(&dev->buffer_lock); - rb_erase(&buffer->node, &dev->buffers); - mutex_unlock(&dev->buffer_lock); if (heap->flags & ION_HEAP_FLAG_DEFER_FREE) ion_heap_freelist_add(heap, buffer); @@ -694,8 +660,6 @@ static int ion_device_create(void) } idev->debug_root = debugfs_create_dir("ion", NULL); - idev->buffers = RB_ROOT; - mutex_init(&idev->buffer_lock); init_rwsem(&idev->lock); plist_head_init(&idev->heaps); internal_dev = idev; diff --git a/drivers/staging/android/ion/ion.h b/drivers/staging/android/ion/ion.h index e291299fd35f..74914a266e25 100644 --- a/drivers/staging/android/ion/ion.h +++ b/drivers/staging/android/ion/ion.h @@ -23,7 +23,6 @@ /** * struct ion_buffer - metadata for a particular buffer - * @node: node in the ion_device buffers tree * @list: element in list of deferred freeable buffers * @dev: back pointer to the ion_device * @heap: back pointer to the heap the buffer came from @@ -39,10 +38,7 @@ * @attachments: list of devices attached to this buffer */ struct ion_buffer { - union { - struct rb_node node; - struct list_head list; - }; + struct list_head list; struct ion_device *dev; struct ion_heap *heap; unsigned long flags; @@ -61,14 +57,10 @@ void ion_buffer_destroy(struct ion_buffer *buffer); /** * struct ion_device - the metadata of the ion device node * @dev: the actual misc device - * @buffers: an rb tree of all the existing buffers - * @buffer_lock: lock protecting the tree of buffers * @lock: rwsem protecting the tree of heaps and clients */ struct ion_device { struct miscdevice dev; - struct rb_root buffers; - struct mutex buffer_lock; struct rw_semaphore lock; struct plist_head heaps; struct dentry *debug_root; Acked-by: Laura Abbott
Re: [PATCH] drm: Add Grain Media GM12U320 driver
Den 12.07.2019 20.53, skrev Hans de Goede: > Add a modesetting driver for Grain Media GM12U320 based devices > (primarily Acer C120 projector, but there may be compatible devices). > > This is based on the fb driver from Viacheslav Nurmekhamitov: > https://github.com/slavrn/gm12u320 > > This driver uses drm_simple_display_pipe to deal with all the atomic > stuff, gem_shmem_helper functions for buffer management and > drm_fbdev_generic_setup for fbdev emulation, so that leaves the driver > itself with only the actual code for talking to the gm13u320 chip, > leading to a nice simple and clean driver. Yeah, it's a lot smaller now than when it was first submitted a couple of years ago ;-) > > Signed-off-by: Hans de Goede > --- > MAINTAINERS | 5 + > drivers/gpu/drm/Kconfig | 2 + > drivers/gpu/drm/Makefile| 1 + > drivers/gpu/drm/gm12u320/Kconfig| 9 + > drivers/gpu/drm/gm12u320/Makefile | 2 + > drivers/gpu/drm/gm12u320/gm12u320.c | 817 > 6 files changed, 836 insertions(+) > create mode 100644 drivers/gpu/drm/gm12u320/Kconfig > create mode 100644 drivers/gpu/drm/gm12u320/Makefile > create mode 100644 drivers/gpu/drm/gm12u320/gm12u320.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index e2db0d467966..754d884eb26b 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -5025,6 +5025,11 @@ S: Maintained > F: drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c > F: > Documentation/devicetree/bindings/display/panel/feiyang,fy07024di26a30d.txt > > +DRM DRIVER FOR GRAIN MEDIA GM12U320 PROJECTORS > +M: Hans de Goede I assume this will be a drm-misc driver: T: git git://anongit.freedesktop.org/drm/drm-misc > +S: Maintained > +F: drivers/gpu/drm/gm12u320/ > + > DRM DRIVER FOR ILITEK ILI9225 PANELS > M: David Lechner > S: Maintained > diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig > index 36f900d63979..af82002825ed 100644 > --- a/drivers/gpu/drm/Kconfig > +++ b/drivers/gpu/drm/Kconfig > @@ -343,6 +343,8 @@ source "drivers/gpu/drm/panfrost/Kconfig" > > source "drivers/gpu/drm/aspeed/Kconfig" > > +source "drivers/gpu/drm/gm12u320/Kconfig" > + > # Keep legacy drivers last > > menuconfig DRM_LEGACY > diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile > index 72f5036d9bfa..8a4f851f54a2 100644 > --- a/drivers/gpu/drm/Makefile > +++ b/drivers/gpu/drm/Makefile > @@ -113,3 +113,4 @@ obj-$(CONFIG_DRM_VBOXVIDEO) += vboxvideo/ > obj-$(CONFIG_DRM_LIMA) += lima/ > obj-$(CONFIG_DRM_PANFROST) += panfrost/ > obj-$(CONFIG_DRM_ASPEED_GFX) += aspeed/ > +obj-$(CONFIG_DRM_GM12U320) += gm12u320/ > diff --git a/drivers/gpu/drm/gm12u320/Kconfig > b/drivers/gpu/drm/gm12u320/Kconfig > new file mode 100644 > index ..0882a61c04d5 > --- /dev/null > +++ b/drivers/gpu/drm/gm12u320/Kconfig > @@ -0,0 +1,9 @@ > +# SPDX-License-Identifier: GPL-2.0+ > +config DRM_GM12U320 > + tristate "GM12U320 driver for USB projectors" > + depends on DRM && USB > + select DRM_KMS_HELPER > + select DRM_GEM_SHMEM_HELPER > + help > + This is a KMS driver for projectors which use the GM12U320 chipset > + for video transfer over USB2/3, such as the Acer C120 mini projector. > diff --git a/drivers/gpu/drm/gm12u320/Makefile > b/drivers/gpu/drm/gm12u320/Makefile > new file mode 100644 > index ..ea514382f00d > --- /dev/null > +++ b/drivers/gpu/drm/gm12u320/Makefile > @@ -0,0 +1,2 @@ > +# SPDX-License-Identifier: GPL-2.0+ > +obj-$(CONFIG_DRM_GM12U320) += gm12u320.o > diff --git a/drivers/gpu/drm/gm12u320/gm12u320.c > b/drivers/gpu/drm/gm12u320/gm12u320.c > new file mode 100644 > index ..ccbbd62f444d > --- /dev/null > +++ b/drivers/gpu/drm/gm12u320/gm12u320.c > @@ -0,0 +1,817 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * Copyright 2019 Hans de Goede > + */ > + > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +static bool eco_mode; > +module_param(eco_mode, bool, 0644); > +MODULE_PARM_DESC(eco_mode, "Turn on Eco mode (less bright, more silent)"); > + > +#define DRIVER_NAME "gm12u320" > +#define DRIVER_DESC "Grain Media GM12U320 USB projector display" > +#define DRIVER_DATE "2019" > +#define DRIVER_MAJOR 1 > +#define DRIVER_MINOR 0 > +#define DRIVER_PATCHLEVEL1 > + > +/* > + * The DLP has an actual width of 854 pixels, but that is not a multiple > + * of 8, breaking things left and right, so we export a width of 848. > + */ > +#define GM12U320_USER_WIDTH 848 > +#define GM12U320_REAL_WIDTH 854 > +#define GM12U320_HEIGHT 480 > + > +#define GM12U320_BLOCK_COUNT 20 > + > +#define MISC_RCV_EPT 1 > +#define DATA_RCV_EPT
[PATCH] drm: Make the bw/link rate calculations more forgiving
From: Sean Paul Although the DisplayPort spec explicitly calls out the 1.62/2.7/5.4/8.1 link rates, the value of LINK_BW_SET is calculated. The DisplayPort spec says "Main-Link Bandwidth Setting = Value x 0.27Gbps/lane". A bridge that we're looking to upstream uses 6.75Gbps rate (value 0x19) [1], and that precludes it from using these functions. This patch calculates the values according to spec instead of restricting these values to one of the DP_LINK_BW_* #defines. No functional change for the well-defined values, but we lose the warning for ill-defined bw values. Signed-off-by: Sean Paul [1] https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1689251/2/drivers/gpu/drm/bridge/analogix/anx7625.c#636 --- drivers/gpu/drm/drm_dp_helper.c | 31 --- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 0b994d083a89..ffc68d305afe 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -152,38 +152,15 @@ EXPORT_SYMBOL(drm_dp_link_train_channel_eq_delay); u8 drm_dp_link_rate_to_bw_code(int link_rate) { - switch (link_rate) { - default: - WARN(1, "unknown DP link rate %d, using %x\n", link_rate, -DP_LINK_BW_1_62); - /* fall through */ - case 162000: - return DP_LINK_BW_1_62; - case 27: - return DP_LINK_BW_2_7; - case 54: - return DP_LINK_BW_5_4; - case 81: - return DP_LINK_BW_8_1; - } + /* Spec says link_bw = link_rate / 0.27Gbps */ + return link_rate / 27000; } EXPORT_SYMBOL(drm_dp_link_rate_to_bw_code); int drm_dp_bw_code_to_link_rate(u8 link_bw) { - switch (link_bw) { - default: - WARN(1, "unknown DP link BW code %x, using 162000\n", link_bw); - /* fall through */ - case DP_LINK_BW_1_62: - return 162000; - case DP_LINK_BW_2_7: - return 27; - case DP_LINK_BW_5_4: - return 54; - case DP_LINK_BW_8_1: - return 81; - } + /* Spec says link_rate = link_bw * 0.27Gbps */ + return link_bw * 27000; } EXPORT_SYMBOL(drm_dp_bw_code_to_link_rate); -- Sean Paul, Software Engineer, Google / Chromium OS ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 109955] amdgpu [RX Vega 64] system freeze while gaming
https://bugs.freedesktop.org/show_bug.cgi?id=109955 --- Comment #54 from Sylvain BERTRAND --- power management related code is in amdgpu, then the right place is here, the "dri" and "amdgfx" mailing lists (aka linux gpu driver mailing lists). As far as I am concerned, when I play dota2, I always switch the GPU dpm to high and the CPU freq governor to perf (because, all those things steal a significant amount of fps... actually, I do switch my GPU dpm to high just in case it would be nasty like the cpu governor). -- You are receiving this mail because: You are the assignee for the bug.___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Bug 109955] amdgpu [RX Vega 64] system freeze while gaming
power management related code is in amdgpu, then the right place is here, the "dri" and "amdgfx" mailing lists (aka linux gpu driver mailing lists). As far as I am concerned, when I play dota2, I always switch the GPU dpm to high and the CPU freq governor to perf (because, all those things steal a significant amount of fps... actually, I do switch my GPU dpm to high just in case it would be nasty like the cpu governor). -- Sylvain ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 05/10] drm/tinydrm: Clean up tinydrm_spi_transfer()
Den 17.07.2019 15.09, skrev Sam Ravnborg: > On Wed, Jul 17, 2019 at 01:58:12PM +0200, Noralf Trønnes wrote: >> Prep work before moving the function to mipi-dbi. >> >> tinydrm_spi_transfer() was made to support one class of drivers in >> drivers/staging/fbtft that has not been converted to DRM yet, so strip >> away the unused functionality: >> - Start byte (header) is not used. >> - No driver relies on the automatic 16-bit byte swapping on little endian >> machines with SPI controllers only supporting 8 bits per word. > > Keeping unused code around is never a good idea. > On the other hand, should we not try to get the driver in questions > ported so we have a user and we do not need to re-add this later? > What driver/display needs this? At least drivers/staging/fbtft/fb_ili932{0,5}.c and maybe another one, I don't remember. I haven't worked on fbtft after I did tinydrm. It looks like they still sell the hy28b: https://www.hotmcu.com/28-touch-screen-tft-lcd-with-all-interface-p-63.html I'm not sure what the future of fbtft is. The idea was that the drivers should get cleaned up and move out of staging, but then fbdev was closed for new drivers and I did tinydrm. Only two drivers have been converted apart from mi0283qt that I did and that is hx8357 which Eric did and st7735 that David did. Those 3 covers a lot of the tiny SPI display marked, Adafruit sells them. It's a chicken and egg problem, as long as the fbtft drivers are there and working, there's no incentive to convert them. There's another challenge with these drivers since it is possible to override the init sequence in Device Tree, meaning they can work with all kinds of displays without writing a new driver. I was not allowed to keep that functionality outside of staging. When I'm done with the tinydrm cleanup, I'm going to work on an idea I have: turn the Raspberry Pi Zero into a $5 USB to HDMI/SDTV/DSI/DPI/SPI-display adapter. I'm planning to write a generic USB host display driver with a matching Linux OTG device driver. I plan to make it easy to do the display OTG side on a microcontroller as well. This way it will be possible for manufacturers to do USB connected displays of (nearly) all sizes without having to write a Linux driver. It's difficult to predict the future, but powerful microcontrollers are cheap nowadays so maybe these SPI displays will be fased out by cheap USB displays. The uC can replace the touch controller cutting some of the uC cost. Noralf. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm: Make the bw/link rate calculations more forgiving
On Wed, Jul 17, 2019 at 12:01:48PM -0400, Sean Paul wrote: > From: Sean Paul > > Although the DisplayPort spec explicitly calls out the 1.62/2.7/5.4/8.1 > link rates, the value of LINK_BW_SET is calculated. The DisplayPort > spec says "Main-Link Bandwidth Setting = Value x 0.27Gbps/lane". > > A bridge that we're looking to upstream uses 6.75Gbps rate (value 0x19) > [1], and that precludes it from using these functions. The DP spec has this note: "A MyDP Source device, upon reading the MAX_LINK_RATE register of the downstream DPRX programmed to 19h (which can be the case only for a MyDP-to-Legacy or MyDP-to-DP lane count converter) can program the LINK_BW_SET register (DPCD Address 00100h) to 19h to enable 6.75Gbps/lane." Which I guess is the thing you're seeing. But I think the patch makes sense in any case. Otherwise anyone who plugs in some new display to a machine with an old kernel will likely get that WARN. Assuming the driver correctly limits the max link rate based on the source device capabilities there's no harm in letting the sink declare higher limits. Reviewed-by: Ville Syrjälä > > This patch calculates the values according to spec instead of > restricting these values to one of the DP_LINK_BW_* #defines. > > No functional change for the well-defined values, but we lose the > warning for ill-defined bw values. > > Signed-off-by: Sean Paul > > [1] > https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1689251/2/drivers/gpu/drm/bridge/analogix/anx7625.c#636 > --- > drivers/gpu/drm/drm_dp_helper.c | 31 --- > 1 file changed, 4 insertions(+), 27 deletions(-) > > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c > index 0b994d083a89..ffc68d305afe 100644 > --- a/drivers/gpu/drm/drm_dp_helper.c > +++ b/drivers/gpu/drm/drm_dp_helper.c > @@ -152,38 +152,15 @@ EXPORT_SYMBOL(drm_dp_link_train_channel_eq_delay); > > u8 drm_dp_link_rate_to_bw_code(int link_rate) > { > - switch (link_rate) { > - default: > - WARN(1, "unknown DP link rate %d, using %x\n", link_rate, > - DP_LINK_BW_1_62); > - /* fall through */ > - case 162000: > - return DP_LINK_BW_1_62; > - case 27: > - return DP_LINK_BW_2_7; > - case 54: > - return DP_LINK_BW_5_4; > - case 81: > - return DP_LINK_BW_8_1; > - } > + /* Spec says link_bw = link_rate / 0.27Gbps */ > + return link_rate / 27000; > } > EXPORT_SYMBOL(drm_dp_link_rate_to_bw_code); > > int drm_dp_bw_code_to_link_rate(u8 link_bw) > { > - switch (link_bw) { > - default: > - WARN(1, "unknown DP link BW code %x, using 162000\n", link_bw); > - /* fall through */ > - case DP_LINK_BW_1_62: > - return 162000; > - case DP_LINK_BW_2_7: > - return 27; > - case DP_LINK_BW_5_4: > - return 54; > - case DP_LINK_BW_8_1: > - return 81; > - } > + /* Spec says link_rate = link_bw * 0.27Gbps */ > + return link_bw * 27000; > } > EXPORT_SYMBOL(drm_dp_bw_code_to_link_rate); > > -- > Sean Paul, Software Engineer, Google / Chromium OS > > ___ > 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
Re: [PATCH 06/10] drm/tinydrm: Move tinydrm_spi_transfer()
Den 17.07.2019 15.15, skrev Sam Ravnborg: > Hi Noralf. > > On Wed, Jul 17, 2019 at 01:58:13PM +0200, Noralf Trønnes wrote: >> This is only used by mipi-dbi drivers so move it there. >> >> The reason this isn't moved to the SPI subsystem is that it will in a >> later patch pass a dummy rx buffer for SPI controllers that need this. >> Low memory boards (64MB) can run into a problem allocating such a "large" >> contiguous buffer on every transfer after a long up time. >> This leaves a very specific use case, so we'll keep the function here. >> mipi-dbi will first go through a refactoring though, before this will >> be done. >> >> Remove SPI todo entry now that we're done with the tinydrm.ko SPI code. >> >> Additionally move the mipi_dbi_spi_init() declaration to the other SPI >> functions. >> >> Cc: David Lechner >> Signed-off-by: Noralf Trønnes > With the few nitpics considered: > Reviewed-by: Sam Ravnborg > > >> diff --git a/include/drm/tinydrm/mipi-dbi.h b/include/drm/tinydrm/mipi-dbi.h >> index 51fc667beef7..576e9a7349ab 100644 >> --- a/include/drm/tinydrm/mipi-dbi.h >> +++ b/include/drm/tinydrm/mipi-dbi.h >> @@ -67,8 +67,6 @@ static inline struct mipi_dbi *drm_to_mipi_dbi(struct >> drm_device *drm) >> return container_of(drm, struct mipi_dbi, drm); >> } >> >> -int mipi_dbi_spi_init(struct spi_device *spi, struct mipi_dbi *mipi, >> - struct gpio_desc *dc); > Moving this prototype looks like it belongs in another patch? > Strictly speaking it does, if you don't like I'll just drop it. Noralf. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 00/10] drm/tinydrm: Remove tinydrm.ko
Den 17.07.2019 15.31, skrev Sam Ravnborg: > Hi Noralf. > > Nice series of patches! > > > > On Wed, Jul 17, 2019 at 01:58:07PM +0200, Noralf Trønnes wrote: >> This series removes the remaining bits of tinydrm.ko. >> >> There's only one item left on the tinydrm todo list and that is moving >> out mipi_dbi. >> >> Note: >> This depends on a commit that just entered Linus' tree: >> e6f3f7e4dc76 ("spi: Add spi_is_bpw_supported()") >> >> Series is also available here: >> https://github.com/notro/linux/tree/remove_tinydrm_ko >> >> Noralf. >> >> Noralf Trønnes (10): >> drm: Add SPI connector type >> drm/tinydrm: Use spi_is_bpw_supported() >> drm/tinydrm: Remove spi debug buffer dumping >> drm/tinydrm: Remove tinydrm_spi_max_transfer_size() >> drm/tinydrm: Clean up tinydrm_spi_transfer() >> drm/tinydrm: Move tinydrm_spi_transfer() >> drm/tinydrm: Move tinydrm_machine_little_endian() >> drm/tinydrm/repaper: Don't use tinydrm_display_pipe_init() >> drm/tinydrm/mipi-dbi: Add mipi_dbi_init_with_formats() >> drm/tinydrm: Move tinydrm_display_pipe_init() to mipi-dbi >> > > Patch 1-3, 7, 8, 9 are: > Reviewed-by: Sam Ravnborg > > Patch 4 are: > Acked-by: Sam Ravnborg > (Did not feel I had enough background to say r-b). > > Individual comments sent for the other patches. > Thanks for your review Sam! Noralf. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm: Make the bw/link rate calculations more forgiving
On Wed, Jul 17, 2019 at 07:20:29PM +0300, Ville Syrjälä wrote: > On Wed, Jul 17, 2019 at 12:01:48PM -0400, Sean Paul wrote: > > From: Sean Paul > > > > Although the DisplayPort spec explicitly calls out the 1.62/2.7/5.4/8.1 > > link rates, the value of LINK_BW_SET is calculated. The DisplayPort > > spec says "Main-Link Bandwidth Setting = Value x 0.27Gbps/lane". > > > > A bridge that we're looking to upstream uses 6.75Gbps rate (value 0x19) > > [1], and that precludes it from using these functions. > > The DP spec has this note: > "A MyDP Source device, upon reading the MAX_LINK_RATE register of the > downstream DPRX programmed to 19h (which can be the case only for a > MyDP-to-Legacy or MyDP-to-DP lane count converter) can program the > LINK_BW_SET register (DPCD Address 00100h) to 19h to enable 6.75Gbps/lane." > > Which I guess is the thing you're seeing. Thanks for digging this up. The spec I reviewed didn't have this, but it did mention some more esoteric exceptions to the Big 4 (it might not even have HBR3 either, I'm not sure. /me really needs to get up-to-date specs) defined rates. I'll add this to my commit message when I apply it. > > But I think the patch makes sense in any case. Otherwise anyone who > plugs in some new display to a machine with an old kernel will likely > get that WARN. Assuming the driver correctly limits the max link rate > based on the source device capabilities there's no harm in letting > the sink declare higher limits. Yep, and not only the WARN, but they'll also get 1.62Gbps rate/code. So calculating the value seems like the safer route to take. > > Reviewed-by: Ville Syrjälä Thanks! I'll apply it to drm-misc-next. Sean > > > > > This patch calculates the values according to spec instead of > > restricting these values to one of the DP_LINK_BW_* #defines. > > > > No functional change for the well-defined values, but we lose the > > warning for ill-defined bw values. > > > > Signed-off-by: Sean Paul > > > > [1] > > https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1689251/2/drivers/gpu/drm/bridge/analogix/anx7625.c#636 > > --- > > drivers/gpu/drm/drm_dp_helper.c | 31 --- > > 1 file changed, 4 insertions(+), 27 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_dp_helper.c > > b/drivers/gpu/drm/drm_dp_helper.c > > index 0b994d083a89..ffc68d305afe 100644 > > --- a/drivers/gpu/drm/drm_dp_helper.c > > +++ b/drivers/gpu/drm/drm_dp_helper.c > > @@ -152,38 +152,15 @@ EXPORT_SYMBOL(drm_dp_link_train_channel_eq_delay); > > > > u8 drm_dp_link_rate_to_bw_code(int link_rate) > > { > > - switch (link_rate) { > > - default: > > - WARN(1, "unknown DP link rate %d, using %x\n", link_rate, > > -DP_LINK_BW_1_62); > > - /* fall through */ > > - case 162000: > > - return DP_LINK_BW_1_62; > > - case 27: > > - return DP_LINK_BW_2_7; > > - case 54: > > - return DP_LINK_BW_5_4; > > - case 81: > > - return DP_LINK_BW_8_1; > > - } > > + /* Spec says link_bw = link_rate / 0.27Gbps */ > > + return link_rate / 27000; > > } > > EXPORT_SYMBOL(drm_dp_link_rate_to_bw_code); > > > > int drm_dp_bw_code_to_link_rate(u8 link_bw) > > { > > - switch (link_bw) { > > - default: > > - WARN(1, "unknown DP link BW code %x, using 162000\n", link_bw); > > - /* fall through */ > > - case DP_LINK_BW_1_62: > > - return 162000; > > - case DP_LINK_BW_2_7: > > - return 27; > > - case DP_LINK_BW_5_4: > > - return 54; > > - case DP_LINK_BW_8_1: > > - return 81; > > - } > > + /* Spec says link_rate = link_bw * 0.27Gbps */ > > + return link_bw * 27000; > > } > > EXPORT_SYMBOL(drm_dp_bw_code_to_link_rate); > > > > -- > > Sean Paul, Software Engineer, Google / Chromium OS > > > > ___ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > -- > Ville Syrjälä > Intel -- Sean Paul, Software Engineer, Google / Chromium OS ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Limits for ION Memory Allocator
Hello! The syzkaller [1] has a trouble with fuzzing the Linux kernel with ION Memory Allocator. Syzkaller uses several methods [2] to limit memory consumption of the userspace processes calling the syscalls for testing the kernel: - setrlimit(), - cgroups, - various sysctl. But these methods don't work for ION Memory Allocator, so any userspace process that has access to /dev/ion can bring the system to the out-of-memory state. An example of a program doing that: #include #include #include #include #include #include #define ION_IOC_MAGIC 'I' #define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, \ struct ion_allocation_data) struct ion_allocation_data { __u64 len; __u32 heap_id_mask; __u32 flags; __u32 fd; __u32 unused; }; int main(void) { unsigned long i = 0; int fd = -1; struct ion_allocation_data data = { .len = 0x13f65d8c, .heap_id_mask = 1, .flags = 0, .fd = -1, .unused = 0 }; fd = open("/dev/ion", 0); if (fd == -1) { perror("[-] open /dev/ion"); return 1; } while (1) { printf("iter %lu\n", i); ioctl(fd, ION_IOC_ALLOC, &data); i++; } return 0; } I looked through the code of ion_alloc() and didn't find any limit checks. Is it currently possible to limit ION kernel allocations for some process? If not, is it a right idea to do that? Thanks! Best regards, Alexander [1]: https://github.com/google/syzkaller [2]: https://github.com/google/syzkaller/blob/master/executor/common_linux.h
Re: [PATCH] drm/panel: simple: Doxygenize 'struct panel_desc'; rename a few functions
Hi Doug. On Fri, Jul 12, 2019 at 09:33:33AM -0700, Douglas Anderson wrote: > This attempts to address outstanding review feedback from commit > b8a2948fa2b3 ("drm/panel: simple: Add ability to override typical > timing"). Specifically: > > * It was requested that I document (in the structure definition) that > the device tree override had no effect if 'struct drm_display_mode' > was used in the panel description. I have provided full Doxygen > comments for 'struct panel_desc' to accomplish that. > * panel_simple_get_fixed_modes() was thought to be a confusing name, > so it has been renamed to panel_simple_get_display_modes(). > * panel_simple_parse_override_mode() was thought to be better named as > panel_simple_parse_panel_timing_node(). > > Suggested-by: Sam Ravnborg > Signed-off-by: Douglas Anderson Thanks. I updated the $subject to: drm/panel: simple: document panel_desc; rename a few functions And pushed out to drm-misc-next. > - Sam said that there was still something that he didn't understand > with regards to the flags. Sam: if this is something that needs to > be addressed, please yell. Need to re-visit this later when I have familiarized myself with the new yaml syntax and what impact any potential changes may have on the panel drivers. So for now we leave it as is. Sam ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Letux-kernel] [PATCH v3 0/5] drm/panel-simple: Add panel parameters for ortustech-com37h3m05dtc/99dtc and sharp-lq070y3dg3b
Hi Sam, > Am 26.06.2019 um 14:40 schrieb H. Nikolaus Schaller : > > Hi Sam, > >> Am 26.06.2019 um 09:33 schrieb Sam Ravnborg : >> >> Hi Nikolaus. >> any progress towards merging this somewhere? It did not yet arrive in linux-next. BTW: should also be applied to 5.2 >>> The drm bits are reviewed. The DT bits needs OK from DT people. >>> When we have OK from DT people we can apply them all to drm-misc-next. >> >> I got OK on irc from Rob to process these. >> All patches are now applied to drm-misc-next. > > Thanks for taking care of this! I have checked but it seems they are still not merged into linux-next. BR and thanks, Nikolaus
Re: [PATCH 05/10] drm/tinydrm: Clean up tinydrm_spi_transfer()
Hi Noralf. On Wed, Jul 17, 2019 at 06:18:39PM +0200, Noralf Trønnes wrote: > > > Den 17.07.2019 15.09, skrev Sam Ravnborg: > > On Wed, Jul 17, 2019 at 01:58:12PM +0200, Noralf Trønnes wrote: > >> Prep work before moving the function to mipi-dbi. > >> > >> tinydrm_spi_transfer() was made to support one class of drivers in > >> drivers/staging/fbtft that has not been converted to DRM yet, so strip > >> away the unused functionality: > >> - Start byte (header) is not used. > >> - No driver relies on the automatic 16-bit byte swapping on little endian > >> machines with SPI controllers only supporting 8 bits per word. > > > > Keeping unused code around is never a good idea. > > On the other hand, should we not try to get the driver in questions > > ported so we have a user and we do not need to re-add this later? > > What driver/display needs this? > > At least drivers/staging/fbtft/fb_ili932{0,5}.c and maybe another one, I > don't remember. I haven't worked on fbtft after I did tinydrm. > It looks like they still sell the hy28b: > https://www.hotmcu.com/28-touch-screen-tft-lcd-with-all-interface-p-63.html I ordered one, then we will see if I also find time to port the driver and test it. > I'm not sure what the future of fbtft is. The idea was that the drivers > should get cleaned up and move out of staging, but then fbdev was closed > for new drivers and I did tinydrm. Only two drivers have been converted > apart from mi0283qt that I did and that is hx8357 which Eric did and > st7735 that David did. Those 3 covers a lot of the tiny SPI display > marked, Adafruit sells them. > It's a chicken and egg problem, as long as the fbtft drivers are there > and working, there's no incentive to convert them. I follow the average joe user here. If it works then why worry. But if I get HW and time I can at least port over a few of them. It looks like it takes more time to test than to do the porting. > There's another challenge with these drivers since it is possible to > override the init sequence in Device Tree, meaning they can work with > all kinds of displays without writing a new driver. > I was not allowed to keep that functionality outside of staging. > > When I'm done with the tinydrm cleanup, I'm going to work on an idea I > have: turn the Raspberry Pi Zero into a $5 USB to > HDMI/SDTV/DSI/DPI/SPI-display adapter. I'm planning to write a generic > USB host display driver with a matching Linux OTG device driver. > I plan to make it easy to do the display OTG side on a microcontroller > as well. This way it will be possible for manufacturers to do USB > connected displays of (nearly) all sizes without having to write a Linux > driver. It will be interesting to follow this, keep us posted. > It's difficult to predict the future, but powerful microcontrollers are > cheap nowadays so maybe these SPI displays will be fased out by cheap > USB displays. The uC can replace the touch controller cutting some of > the uC cost. Yep, it is impressive what one can get for USD 5 these days. Sam ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Letux-kernel] [PATCH v3 0/5] drm/panel-simple: Add panel parameters for ortustech-com37h3m05dtc/99dtc and sharp-lq070y3dg3b
Hi Nikolaus. > BTW: should also be applied to 5.2 > >>> The drm bits are reviewed. The DT bits needs OK from DT people. > >>> When we have OK from DT people we can apply them all to drm-misc-next. > >> > >> I got OK on irc from Rob to process these. > >> All patches are now applied to drm-misc-next. > > > > Thanks for taking care of this! > > I have checked but it seems they are still not merged into linux-next. They will appear in next merge window. They were to late to hit current merge window, as the cut-of time is around .rc5 in the drm subsystem. And this is not really a fix so not stable material. Sam
[PATCH 1/5] drm/panfrost: Restructure the GEM object creation
Setting the GPU VA when creating the GEM object doesn't allow for any conditional adjustments. In preparation to support adjusting the mapping, restructure the GEM object creation to map the GEM object after we've created the base shmem object. Cc: Tomeu Vizoso Cc: Boris Brezillon Cc: Robin Murphy Cc: Steven Price Cc: Alyssa Rosenzweig Signed-off-by: Rob Herring --- drivers/gpu/drm/panfrost/panfrost_drv.c | 21 +++-- drivers/gpu/drm/panfrost/panfrost_gem.c | 58 - drivers/gpu/drm/panfrost/panfrost_gem.h | 5 +++ 3 files changed, 59 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index cb43ff4ebf4a..d354b92964d5 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -46,29 +46,20 @@ static int panfrost_ioctl_get_param(struct drm_device *ddev, void *data, struct static int panfrost_ioctl_create_bo(struct drm_device *dev, void *data, struct drm_file *file) { - int ret; - struct drm_gem_shmem_object *shmem; + struct panfrost_gem_object *bo; struct drm_panfrost_create_bo *args = data; if (!args->size || args->flags || args->pad) return -EINVAL; - shmem = drm_gem_shmem_create_with_handle(file, dev, args->size, -&args->handle); - if (IS_ERR(shmem)) - return PTR_ERR(shmem); - - ret = panfrost_mmu_map(to_panfrost_bo(&shmem->base)); - if (ret) - goto err_free; + bo = panfrost_gem_create_with_handle(file, dev, args->size, args->flags, +&args->handle); + if (IS_ERR(bo)) + return PTR_ERR(bo); - args->offset = to_panfrost_bo(&shmem->base)->node.start << PAGE_SHIFT; + args->offset = bo->node.start << PAGE_SHIFT; return 0; - -err_free: - drm_gem_handle_delete(file, args->handle); - return ret; } /** diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index 543ab1b81bd5..df70dcf3cb2f 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gem.c +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c @@ -23,7 +23,8 @@ static void panfrost_gem_free_object(struct drm_gem_object *obj) panfrost_mmu_unmap(bo); spin_lock(&pfdev->mm_lock); - drm_mm_remove_node(&bo->node); + if (drm_mm_node_allocated(&bo->node)) + drm_mm_remove_node(&bo->node); spin_unlock(&pfdev->mm_lock); drm_gem_shmem_free_object(obj); @@ -50,10 +51,7 @@ static const struct drm_gem_object_funcs panfrost_gem_funcs = { */ struct drm_gem_object *panfrost_gem_create_object(struct drm_device *dev, size_t size) { - int ret; - struct panfrost_device *pfdev = dev->dev_private; struct panfrost_gem_object *obj; - u64 align; obj = kzalloc(sizeof(*obj), GFP_KERNEL); if (!obj) @@ -61,20 +59,52 @@ struct drm_gem_object *panfrost_gem_create_object(struct drm_device *dev, size_t obj->base.base.funcs = &panfrost_gem_funcs; - size = roundup(size, PAGE_SIZE); - align = size >= SZ_2M ? SZ_2M >> PAGE_SHIFT : 0; + return &obj->base.base; +} + +static int panfrost_gem_map(struct panfrost_device *pfdev, struct panfrost_gem_object *bo) +{ + int ret; + size_t size = bo->base.base.size; + u64 align = size >= SZ_2M ? SZ_2M >> PAGE_SHIFT : 0; spin_lock(&pfdev->mm_lock); - ret = drm_mm_insert_node_generic(&pfdev->mm, &obj->node, + ret = drm_mm_insert_node_generic(&pfdev->mm, &bo->node, size >> PAGE_SHIFT, align, 0, 0); spin_unlock(&pfdev->mm_lock); + if (ret) + return ret; + + return panfrost_mmu_map(bo); +} + +struct panfrost_gem_object * +panfrost_gem_create_with_handle(struct drm_file *file_priv, +struct drm_device *dev, size_t size, +u32 flags, +uint32_t *handle) +{ + int ret; + struct panfrost_device *pfdev = dev->dev_private; + struct drm_gem_shmem_object *shmem; + struct panfrost_gem_object *bo; + + size = roundup(size, PAGE_SIZE); + + shmem = drm_gem_shmem_create_with_handle(file_priv, dev, size, handle); + if (IS_ERR(shmem)) + return ERR_CAST(shmem); + + bo = to_panfrost_bo(&shmem->base); + + ret = panfrost_gem_map(pfdev, bo); if (ret) goto free_obj; - return &obj->base.base; + return bo; free_obj: - kfree(obj); + drm_gem_handle_delete(file_priv, *handle); return ERR_PTR(ret); } @@ -83,8 +113,10 @@ panfrost_gem_prime_import_sg_table(struct drm_device *dev, struct dma_buf_attachment *attach,
[PATCH 3/5] drm/panfrost: Add a no execute flag for BO allocations
Executable buffers have an alignment restriction that they can't cross 16MB boundary as the GPU program counter is 24-bits. This restriction is currently not handled and we just get lucky. As current userspace assumes all BOs are executable, that has to remain the default. So add a new PANFROST_BO_NOEXEC flag to allow userspace to indicate which BOs are not executable. There is also a restriction that executable buffers cannot start or end on a 4GB boundary. This is mostly avoided as there is only 4GB of space currently and the beginning is already blocked out for NULL ptr detection. Add support to handle this restriction fully regardless of the current constraints. For existing userspace, all created BOs remain executable, but the GPU VA alignment will be increased to the size of the BO. This shouldn't matter as there is plenty of GPU VA space. Cc: Tomeu Vizoso Cc: Boris Brezillon Cc: Robin Murphy Cc: Steven Price Cc: Alyssa Rosenzweig Signed-off-by: Rob Herring --- drivers/gpu/drm/panfrost/panfrost_drv.c | 20 +++- drivers/gpu/drm/panfrost/panfrost_gem.c | 18 -- drivers/gpu/drm/panfrost/panfrost_gem.h | 3 ++- drivers/gpu/drm/panfrost/panfrost_mmu.c | 3 +++ include/uapi/drm/panfrost_drm.h | 2 ++ 5 files changed, 42 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index d354b92964d5..b91e991bc6a3 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -49,7 +49,8 @@ static int panfrost_ioctl_create_bo(struct drm_device *dev, void *data, struct panfrost_gem_object *bo; struct drm_panfrost_create_bo *args = data; - if (!args->size || args->flags || args->pad) + if (!args->size || args->pad || + (args->flags & ~PANFROST_BO_NOEXEC)) return -EINVAL; bo = panfrost_gem_create_with_handle(file, dev, args->size, args->flags, @@ -367,6 +368,22 @@ static struct drm_driver panfrost_drm_driver = { .gem_prime_mmap = drm_gem_prime_mmap, }; +#define PFN_4G_MASK((SZ_4G - 1) >> PAGE_SHIFT) + +static void panfrost_drm_mm_color_adjust(const struct drm_mm_node *node, +unsigned long color, +u64 *start, u64 *end) +{ + /* Executable buffers can't start or end on a 4GB boundary */ + if (!color) { + if ((*start & PFN_4G_MASK) == 0) + (*start)++; + + if ((*end & PFN_4G_MASK) == 0) + (*end)--; + } +} + static int panfrost_probe(struct platform_device *pdev) { struct panfrost_device *pfdev; @@ -394,6 +411,7 @@ static int panfrost_probe(struct platform_device *pdev) /* 4G enough for now. can be 48-bit */ drm_mm_init(&pfdev->mm, SZ_32M >> PAGE_SHIFT, (SZ_4G - SZ_32M) >> PAGE_SHIFT); + pfdev->mm.color_adjust = panfrost_drm_mm_color_adjust; pm_runtime_use_autosuspend(pfdev->dev); pm_runtime_set_autosuspend_delay(pfdev->dev, 50); /* ~3 frames */ diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index df70dcf3cb2f..37ffec8391da 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gem.c +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c @@ -66,11 +66,23 @@ static int panfrost_gem_map(struct panfrost_device *pfdev, struct panfrost_gem_o { int ret; size_t size = bo->base.base.size; - u64 align = size >= SZ_2M ? SZ_2M >> PAGE_SHIFT : 0; + u64 align; + + /* +* Executable buffers cannot cross a 16MB boundary as the program +* counter is 24-bits. We assume executable buffers will be less than +* 16MB and aligning executable buffers to their size will avoid +* crossing a 16MB boundary. +*/ + if (!bo->noexec) + align = size >> PAGE_SHIFT; + else + align = size >= SZ_2M ? SZ_2M >> PAGE_SHIFT : 0; spin_lock(&pfdev->mm_lock); ret = drm_mm_insert_node_generic(&pfdev->mm, &bo->node, -size >> PAGE_SHIFT, align, 0, 0); +size >> PAGE_SHIFT, align, +bo->noexec, 0); spin_unlock(&pfdev->mm_lock); if (ret) return ret; @@ -96,6 +108,7 @@ panfrost_gem_create_with_handle(struct drm_file *file_priv, return ERR_CAST(shmem); bo = to_panfrost_bo(&shmem->base); + bo->noexec = !!(flags & PANFROST_BO_NOEXEC); ret = panfrost_gem_map(pfdev, bo); if (ret) @@ -123,6 +136,7 @@ panfrost_gem_prime_import_sg_table(struct drm_device *dev, return ERR_CAST(obj); pobj = to_panfrost_bo(obj); + pobj->noexec = true; ret = panfrost_gem_map(pfdev, pobj); if (ret) diff --git a/drivers/gpu/dr
[PATCH 2/5] drm/panfrost: Split panfrost_mmu_map SG list mapping to its own function
In preparation to create partial GPU mappings of BOs on page faults, split out the SG list handling of panfrost_mmu_map(). Cc: Tomeu Vizoso Cc: Boris Brezillon Cc: Robin Murphy Cc: Steven Price Cc: Alyssa Rosenzweig Signed-off-by: Rob Herring --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 52 +++-- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index f502e91be42a..5383b837f04b 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -167,27 +167,13 @@ static size_t get_pgsize(u64 addr, size_t size) return SZ_2M; } -int panfrost_mmu_map(struct panfrost_gem_object *bo) +static int mmu_map_sg(struct panfrost_device *pfdev, u64 iova, + int prot, struct sg_table *sgt) { - struct drm_gem_object *obj = &bo->base.base; - struct panfrost_device *pfdev = to_panfrost_device(obj->dev); - struct io_pgtable_ops *ops = pfdev->mmu->pgtbl_ops; - u64 iova = bo->node.start << PAGE_SHIFT; unsigned int count; struct scatterlist *sgl; - struct sg_table *sgt; - int ret; - - if (WARN_ON(bo->is_mapped)) - return 0; - - sgt = drm_gem_shmem_get_pages_sgt(obj); - if (WARN_ON(IS_ERR(sgt))) - return PTR_ERR(sgt); - - ret = pm_runtime_get_sync(pfdev->dev); - if (ret < 0) - return ret; + struct io_pgtable_ops *ops = pfdev->mmu->pgtbl_ops; + u64 start_iova = iova; mutex_lock(&pfdev->mmu->lock); @@ -200,18 +186,42 @@ int panfrost_mmu_map(struct panfrost_gem_object *bo) while (len) { size_t pgsize = get_pgsize(iova | paddr, len); - ops->map(ops, iova, paddr, pgsize, IOMMU_WRITE | IOMMU_READ); + ops->map(ops, iova, paddr, pgsize, prot); iova += pgsize; paddr += pgsize; len -= pgsize; } } - mmu_hw_do_operation(pfdev, 0, bo->node.start << PAGE_SHIFT, - bo->node.size << PAGE_SHIFT, AS_COMMAND_FLUSH_PT); + mmu_hw_do_operation(pfdev, 0, start_iova, iova - start_iova, + AS_COMMAND_FLUSH_PT); mutex_unlock(&pfdev->mmu->lock); + return 0; +} + +int panfrost_mmu_map(struct panfrost_gem_object *bo) +{ + struct drm_gem_object *obj = &bo->base.base; + struct panfrost_device *pfdev = to_panfrost_device(obj->dev); + struct sg_table *sgt; + int ret; + int prot = IOMMU_READ | IOMMU_WRITE; + + if (WARN_ON(bo->is_mapped)) + return 0; + + sgt = drm_gem_shmem_get_pages_sgt(obj); + if (WARN_ON(IS_ERR(sgt))) + return PTR_ERR(sgt); + + ret = pm_runtime_get_sync(pfdev->dev); + if (ret < 0) + return ret; + + mmu_map_sg(pfdev, bo->node.start << PAGE_SHIFT, prot, sgt); + pm_runtime_mark_last_busy(pfdev->dev); pm_runtime_put_autosuspend(pfdev->dev); bo->is_mapped = true; -- 2.20.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 4/5] drm/panfrost: Add support for GPU heap allocations
The midgard/bifrost GPUs need to allocate GPU heap memory which is allocated on GPU page faults and not pinned in memory. The vendor driver calls this functionality GROW_ON_GPF. This implementation assumes that BOs allocated with the PANFROST_BO_NOEXEC flag are never mmapped or exported. Both of those may actually work, but I'm unsure if there's some interaction there. It would cause the whole object to be pinned in memory which would defeat the point of this. On faults, we map in 2MB at a time in order to utilize huge pages (if enabled). Currently, once we've mapped pages in, they are only unmapped if the BO is freed. Once we add shrinker support, we can unmap pages with the shrinker. Cc: Tomeu Vizoso Cc: Boris Brezillon Cc: Robin Murphy Cc: Steven Price Cc: Alyssa Rosenzweig Signed-off-by: Rob Herring --- drivers/gpu/drm/panfrost/TODO | 2 - drivers/gpu/drm/panfrost/panfrost_drv.c | 2 +- drivers/gpu/drm/panfrost/panfrost_gem.c | 14 ++- drivers/gpu/drm/panfrost/panfrost_gem.h | 8 ++ drivers/gpu/drm/panfrost/panfrost_mmu.c | 114 +--- include/uapi/drm/panfrost_drm.h | 1 + 6 files changed, 125 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/panfrost/TODO b/drivers/gpu/drm/panfrost/TODO index c2e44add37d8..64129bf73933 100644 --- a/drivers/gpu/drm/panfrost/TODO +++ b/drivers/gpu/drm/panfrost/TODO @@ -14,8 +14,6 @@ The hard part is handling when more address spaces are needed than what the h/w provides. -- Support pinning pages on demand (GPU page faults). - - Support userspace controlled GPU virtual addresses. Needed for Vulkan. (Tomeu) - Support for madvise and a shrinker. diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index b91e991bc6a3..9e87d0060202 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -50,7 +50,7 @@ static int panfrost_ioctl_create_bo(struct drm_device *dev, void *data, struct drm_panfrost_create_bo *args = data; if (!args->size || args->pad || - (args->flags & ~PANFROST_BO_NOEXEC)) + (args->flags & ~(PANFROST_BO_NOEXEC | PANFROST_BO_HEAP))) return -EINVAL; bo = panfrost_gem_create_with_handle(file, dev, args->size, args->flags, diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c index 37ffec8391da..52839638 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gem.c +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c @@ -87,7 +87,10 @@ static int panfrost_gem_map(struct panfrost_device *pfdev, struct panfrost_gem_o if (ret) return ret; - return panfrost_mmu_map(bo); + if (!bo->is_heap) + ret = panfrost_mmu_map(bo); + + return ret; } struct panfrost_gem_object * @@ -101,7 +104,11 @@ panfrost_gem_create_with_handle(struct drm_file *file_priv, struct drm_gem_shmem_object *shmem; struct panfrost_gem_object *bo; - size = roundup(size, PAGE_SIZE); + /* Round up heap allocations to 2MB to keep fault handling simple */ + if (flags & PANFROST_BO_HEAP) + size = roundup(size, SZ_2M); + else + size = roundup(size, PAGE_SIZE); shmem = drm_gem_shmem_create_with_handle(file_priv, dev, size, handle); if (IS_ERR(shmem)) @@ -109,6 +116,9 @@ panfrost_gem_create_with_handle(struct drm_file *file_priv, bo = to_panfrost_bo(&shmem->base); bo->noexec = !!(flags & PANFROST_BO_NOEXEC); + bo->is_heap = !!(flags & PANFROST_BO_HEAP); + if (bo->is_heap) + bo->noexec = true; ret = panfrost_gem_map(pfdev, bo); if (ret) diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.h b/drivers/gpu/drm/panfrost/panfrost_gem.h index 132f02399b7b..c500ca6b9072 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gem.h +++ b/drivers/gpu/drm/panfrost/panfrost_gem.h @@ -13,6 +13,7 @@ struct panfrost_gem_object { struct drm_mm_node node; bool is_mapped :1; bool noexec :1; + bool is_heap:1; }; static inline @@ -21,6 +22,13 @@ struct panfrost_gem_object *to_panfrost_bo(struct drm_gem_object *obj) return container_of(to_drm_gem_shmem_obj(obj), struct panfrost_gem_object, base); } +static inline +struct panfrost_gem_object *drm_mm_node_to_panfrost_bo(struct drm_mm_node *node) +{ + return container_of(node, struct panfrost_gem_object, node); +} + + struct drm_gem_object *panfrost_gem_create_object(struct drm_device *dev, size_t size); struct panfrost_gem_object * diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index d18484a07bfa..3b95c7027188 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -3,6 +3,7 @@ /* Copyright (C) 2019 Arm Ltd. */ #include #include +#include
[PATCH 5/5] drm/panfrost: Bump driver version to 1.1
Increment the driver version to expose the new BO allocation flags. Cc: Tomeu Vizoso Cc: Boris Brezillon Cc: Robin Murphy Cc: Steven Price Cc: Alyssa Rosenzweig Signed-off-by: Rob Herring --- drivers/gpu/drm/panfrost/panfrost_drv.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 9e87d0060202..615bd15fc106 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -348,6 +348,11 @@ static const struct drm_ioctl_desc panfrost_drm_driver_ioctls[] = { DEFINE_DRM_GEM_SHMEM_FOPS(panfrost_drm_driver_fops); +/* + * Panfrost driver version: + * - 1.0 - initial interface + * - 1.1 - adds HEAP and NOEXEC flags for CREATE_BO + */ static struct drm_driver panfrost_drm_driver = { .driver_features= DRIVER_RENDER | DRIVER_GEM | DRIVER_SYNCOBJ, .open = panfrost_open, @@ -359,7 +364,7 @@ static struct drm_driver panfrost_drm_driver = { .desc = "panfrost DRM", .date = "20180908", .major = 1, - .minor = 0, + .minor = 1, .gem_create_object = panfrost_gem_create_object, .prime_handle_to_fd = drm_gem_prime_handle_to_fd, -- 2.20.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 204145] amdgpu video playback causes host to hard reset (checkstop) on POWER9 with RX 580
https://bugzilla.kernel.org/show_bug.cgi?id=204145 --- Comment #16 from Shawn Anastasio (sh...@anastas.io) --- Created attachment 283799 --> https://bugzilla.kernel.org/attachment.cgi?id=283799&action=edit test patch #1 Though I'm not familiar with this code, a quick spot check shows what I believe to be an inconsistency with the commit's claim of functional identicality. Namely, the previous caller of __dma_get_coherent_pfn (now arch_dma_coherent_to_pfn) would explicitly modify the vm_area to mark it as uncacheable in the !coherent case. It seems the new caller (dma_common_mmap) does not do this. I have written a small patch to restore the previous behavior (I think). Note that this probably isn't upstreamable since this fix should probably go somewhere in the powerpc arch code rather than the dma core. Tim, since you're the only one who can easily reproduce this, would you mind giving this patch a shot? -- 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
[PATCH v10 1/2] drm/i915: Introduce async plane update to i915
From: Gustavo Padovan Add implementation for async plane update callbacks Signed-off-by: Gustavo Padovan Signed-off-by: Enric Balletbo i Serra Signed-off-by: Tina Zhang Signed-off-by: Helen Koike Tested-by: Tina Zhang --- Hi, This is v10, I just fixed the order in how the commit_ready fence is initialized in the intel_atomic_commit() function and solved some conflicts during rebase. This patch depends on [1] "[PATCH] drm: don't block fb changes for async plane updates", which is already on drm-misc, otherwise there will be a regression on igt tests: cursor-vs-flip-atomic-transitions-varying-size cursor-vs-flip-toggle cursor-vs-flip-varying-size with errors of type: "CRITICAL: completed 97 cursor updated in a period of 30 flips, we expect to complete approximately 15360 updates, with the threshold set at 7680" When picking this patch, please backmerge [1] into drm-intel tree. [1] https://cgit.freedesktop.org/drm/drm-misc/commit/?h=drm-misc-fixes&id=89a4aac0ab0e6f5eea10d7bf4869dd15c3de2cd4 Thanks Helen Changes in v10: - v9: https://patchwork.kernel.org/patch/11000561/ - rebase on drm-tip - call i915_sw_fence_init() in the begining of intel_atomic_commit(), otherwise drm_atomic_helper_prepare_planes() without initializing the fence object, casing errors like: ODEBUG: assert_init not available (active state 0) object type: i915_sw_fence hint: 0x0 Changes in v9: - v8: https://patchwork.kernel.org/patch/10843395/ - Added tested-by tag - submitted to intel-...@lists.freedesktop.org to invoke CI - rebased and fixed conflicts on top of drm-tip Changes in v8: - v7: https://lkml.org/lkml/2018/6/8/168 - v7 was splited in two, one that adds the async callbacks and another that updates the cursor. - rebase with drm-intel - allow async update in all types of planes, not only cursor - add watermark checks in async update - remove bypass of intel_prepare_plane_fb() in case of async update - add missing drm_atomic_helper_cleanup_planes(dev, state) call in intel_atomic_commit(). - use swap() function in async update to set the old_fb in the new_state object. - use helpers intel_update_plane()/intel_disable_plane() Changes in v7: - Rebase on top of drm-intel repository. Hopefully now will play nicely with autobuilders. Changes in v6: - Rework the intel_plane_atomic_async_update due driver changed from last time. - Removed the mutex_lock/unlock as causes a deadlock. Changes in v5: - Call drm_atomic_helper_async_check() from the check hook Changes in v4: - Set correct vma to new state for cleanup - Move size checks back to drivers (Ville Syrjälä) Changes in v3: - Move fb setting to core and use new state (Eric Anholt) .../gpu/drm/i915/display/intel_atomic_plane.c | 71 +++ drivers/gpu/drm/i915/display/intel_display.c | 14 +++- 2 files changed, 83 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c index ab411d5e093c..2aa6e2ab4ac8 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c @@ -364,8 +364,79 @@ void i9xx_update_planes_on_crtc(struct intel_atomic_state *state, } } +static int intel_plane_atomic_async_check(struct drm_plane *plane, + struct drm_plane_state *state) +{ + struct drm_crtc_state *crtc_state; + + crtc_state = drm_atomic_get_existing_crtc_state(state->state, + state->crtc); + if (WARN_ON(!crtc_state)) + return -EINVAL; + + /* +* When crtc is inactive or there is a modeset pending, +* wait for it to complete in the slowpath +*/ + if (!crtc_state->active || to_intel_crtc_state(crtc_state)->update_pipe) + return -EINVAL; + + /* +* If any parameters change that may affect watermarks, +* take the slowpath. Only changing fb or position should be +* in the fastpath. +*/ + if (plane->state->crtc != state->crtc || + plane->state->src_w != state->src_w || + plane->state->src_h != state->src_h || + plane->state->crtc_w != state->crtc_w || + plane->state->crtc_h != state->crtc_h || + !plane->state->fb != !state->fb) + return -EINVAL; + + return 0; +} + +static void intel_plane_atomic_async_update(struct drm_plane *plane, + struct drm_plane_state *new_state) +{ + struct intel_atomic_state *intel_new_state = + to_intel_atomic_state(new_state->state); + struct intel_plane *intel_plane = to_intel_plane(plane); + struct drm_crtc *crtc = plane->state->crtc; + struct intel_crtc_state *new_crtc_state; + struct intel_crtc *intel_crtc; + int i; + + for_each_new_intel_crtc_in_state(intel_
[PATCH v10 2/2] drm/i915: update cursors asynchronously through atomic
From: Gustavo Padovan Replace the legacy cursor implementation by the async callbacks Signed-off-by: Gustavo Padovan Signed-off-by: Enric Balletbo i Serra Signed-off-by: Helen Koike --- Changes in v10: None Changes in v9: - v8: https://patchwork.kernel.org/patch/10843397/ - rebased and fixed conflicts on top of drm-tip Changes in v8: - v7: https://lkml.org/lkml/2018/6/8/168 - v7 was splited in two, one that adds the async callbacks and another that updates the cursor. - Update comment in intel_pm.c that was referencing intel_plane_atomic_async_update() Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None drivers/gpu/drm/i915/display/intel_display.c | 165 +-- drivers/gpu/drm/i915/intel_pm.c | 2 +- 2 files changed, 6 insertions(+), 161 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index acfb9b7939e2..619916f63c4f 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -13662,6 +13662,10 @@ static int intel_atomic_check(struct drm_device *dev, if (ret) goto fail; + if (_state->legacy_cursor_update) + _state->async_update = !drm_atomic_helper_async_check(dev, +_state); + intel_fbc_choose_crtc(dev_priv, state); ret = calc_watermark_data(state); if (ret) @@ -14158,34 +14162,6 @@ static int intel_atomic_commit(struct drm_device *dev, drm_atomic_state_get(&state->base); - /* -* The intel_legacy_cursor_update() fast path takes care -* of avoiding the vblank waits for simple cursor -* movement and flips. For cursor on/off and size changes, -* we want to perform the vblank waits so that watermark -* updates happen during the correct frames. Gen9+ have -* double buffered watermarks and so shouldn't need this. -* -* Unset state->legacy_cursor_update before the call to -* drm_atomic_helper_setup_commit() because otherwise -* drm_atomic_helper_wait_for_flip_done() is a noop and -* we get FIFO underruns because we didn't wait -* for vblank. -* -* FIXME doing watermarks and fb cleanup from a vblank worker -* (assuming we had any) would solve these problems. -*/ - if (INTEL_GEN(dev_priv) < 9 && state->base.legacy_cursor_update) { - struct intel_crtc_state *new_crtc_state; - struct intel_crtc *crtc; - int i; - - for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) - if (new_crtc_state->wm.need_postvbl_update || - new_crtc_state->update_wm_post) - state->base.legacy_cursor_update = false; - } - ret = intel_atomic_prepare_commit(state); if (ret) { DRM_DEBUG_ATOMIC("Preparing state failed with %i\n", ret); @@ -14677,139 +14653,8 @@ static const struct drm_plane_funcs i8xx_plane_funcs = { .format_mod_supported = i8xx_plane_format_mod_supported, }; -static int -intel_legacy_cursor_update(struct drm_plane *plane, - struct drm_crtc *crtc, - struct drm_framebuffer *fb, - int crtc_x, int crtc_y, - unsigned int crtc_w, unsigned int crtc_h, - u32 src_x, u32 src_y, - u32 src_w, u32 src_h, - struct drm_modeset_acquire_ctx *ctx) -{ - struct drm_i915_private *dev_priv = to_i915(crtc->dev); - int ret; - struct drm_plane_state *old_plane_state, *new_plane_state; - struct intel_plane *intel_plane = to_intel_plane(plane); - struct drm_framebuffer *old_fb; - struct intel_crtc_state *crtc_state = - to_intel_crtc_state(crtc->state); - struct intel_crtc_state *new_crtc_state; - - /* -* When crtc is inactive or there is a modeset pending, -* wait for it to complete in the slowpath -*/ - if (!crtc_state->base.active || needs_modeset(crtc_state) || - crtc_state->update_pipe) - goto slow; - - old_plane_state = plane->state; - /* -* Don't do an async update if there is an outstanding commit modifying -* the plane. This prevents our async update's changes from getting -* overridden by a previous synchronous update's state. -*/ - if (old_plane_state->commit && - !try_wait_for_completion(&old_plane_state->commit->hw_done)) - goto slow; - - /* -* If any parameters change that may affect watermarks, -* take the slowpath. Only changing fb or position should be -* in th
Re: [PATCH 05/10] drm/tinydrm: Clean up tinydrm_spi_transfer()
On 7/17/19 6:58 AM, Noralf Trønnes wrote: Prep work before moving the function to mipi-dbi. tinydrm_spi_transfer() was made to support one class of drivers in drivers/staging/fbtft that has not been converted to DRM yet, so strip away the unused functionality: - Start byte (header) is not used. - No driver relies on the automatic 16-bit byte swapping on little endian machines with SPI controllers only supporting 8 bits per word. Other changes: - No need to initialize ret - No need for the WARN since mipi-dbi only uses 8 and 16 bpw. - Use spi_message_init_with_transfers() Cc: David Lechner Signed-off-by: Noralf Trønnes --- Acked-by: : David Lechner ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 01/10] drm: Add SPI connector type
On 7/17/19 6:58 AM, Noralf Trønnes wrote: tinydrm drivers announce DRM_MODE_CONNECTOR_VIRTUAL for its SPI drivers. Stop lying and add a SPI connector type Cc: David Lechner Signed-off-by: Noralf Trønnes --- Acked-by: David Lechner ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 204145] amdgpu video playback causes host to hard reset (checkstop) on POWER9 with RX 580
https://bugzilla.kernel.org/show_bug.cgi?id=204145 --- Comment #17 from Shawn Anastasio (sh...@anastas.io) --- On second glance, it seems I got it backwards. pgprot_noncache /is/ actually being set via the default implementation of arch_dma_mmap_pgprot, but this creates the opposite issue. In the coherent case, the vma is now marked as noncache but in the previous implementation it was not. I'll post a new patch to solve this by providing a powerpc implementation of arch_dma_mmap_pgprot that only sets noncache in the !coherent case to match the previous behvaior. -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/10] drm/tinydrm: Move tinydrm_spi_transfer()
On 7/17/19 6:58 AM, Noralf Trønnes wrote: This is only used by mipi-dbi drivers so move it there. The reason this isn't moved to the SPI subsystem is that it will in a later patch pass a dummy rx buffer for SPI controllers that need this. Low memory boards (64MB) can run into a problem allocating such a "large" contiguous buffer on every transfer after a long up time. This leaves a very specific use case, so we'll keep the function here. mipi-dbi will first go through a refactoring though, before this will be done. Remove SPI todo entry now that we're done with the tinydrm.ko SPI code. Additionally move the mipi_dbi_spi_init() declaration to the other SPI functions. Cc: David Lechner Signed-off-by: Noralf Trønnes --- Acked-by: : David Lechner I assume that the comments here might have something to do with the issue[1] I raised a while back? Should I dust that patch off and resend it after this series lands? [1]: https://lore.kernel.org/lkml/1519082461-32405-1-git-send-email-da...@lechnology.com/ ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 204145] amdgpu video playback causes host to hard reset (checkstop) on POWER9 with RX 580
https://bugzilla.kernel.org/show_bug.cgi?id=204145 --- Comment #18 from Shawn Anastasio (sh...@anastas.io) --- Created attachment 283801 --> https://bugzilla.kernel.org/attachment.cgi?id=283801&action=edit test patch #2 Here's the new patch that should restore the previous behavior correctly. -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 07/10] drm/tinydrm: Move tinydrm_machine_little_endian()
On 7/17/19 6:58 AM, Noralf Trønnes wrote: The tinydrm helper is going away so move it into the only user mipi-dbi. Signed-off-by: Noralf Trønnes --- drivers/gpu/drm/tinydrm/mipi-dbi.c| 15 --- include/drm/tinydrm/tinydrm-helpers.h | 15 --- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index 6a8f2d66377f..73db287e5c52 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -628,6 +628,15 @@ u32 mipi_dbi_spi_cmd_max_speed(struct spi_device *spi, size_t len) } EXPORT_SYMBOL(mipi_dbi_spi_cmd_max_speed); +static bool mipi_dbi_machine_little_endian(void) +{ +#if defined(__LITTLE_ENDIAN) + return true; +#else + return false; +#endif +} + I'm kind of surprised that there isn't something like this elsewhere in the kernel already. The way this function is being used it kind of seems like it should be static __always_inline (or a macro) so that the compiler can do a better job optimizing the code (although it is a very minor improvement). ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 204145] amdgpu video playback causes host to hard reset (checkstop) on POWER9 with RX 580
https://bugzilla.kernel.org/show_bug.cgi?id=204145 --- Comment #19 from Shawn Anastasio (sh...@anastas.io) --- Created attachment 283803 --> https://bugzilla.kernel.org/attachment.cgi?id=283803&action=edit test patch #3 oops, missed a couple of includes and made a typo. Fixed those. -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm: Add Grain Media GM12U320 driver
Hi Noralf, Thank you for the review. On 17-07-19 17:24, Noralf Trønnes wrote: Den 12.07.2019 20.53, skrev Hans de Goede: Add a modesetting driver for Grain Media GM12U320 based devices (primarily Acer C120 projector, but there may be compatible devices). This is based on the fb driver from Viacheslav Nurmekhamitov: https://github.com/slavrn/gm12u320 This driver uses drm_simple_display_pipe to deal with all the atomic stuff, gem_shmem_helper functions for buffer management and drm_fbdev_generic_setup for fbdev emulation, so that leaves the driver itself with only the actual code for talking to the gm13u320 chip, leading to a nice simple and clean driver. Yeah, it's a lot smaller now than when it was first submitted a couple of years ago ;-) Ack, this is much better now. Signed-off-by: Hans de Goede --- MAINTAINERS | 5 + drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile| 1 + drivers/gpu/drm/gm12u320/Kconfig| 9 + drivers/gpu/drm/gm12u320/Makefile | 2 + drivers/gpu/drm/gm12u320/gm12u320.c | 817 6 files changed, 836 insertions(+) create mode 100644 drivers/gpu/drm/gm12u320/Kconfig create mode 100644 drivers/gpu/drm/gm12u320/Makefile create mode 100644 drivers/gpu/drm/gm12u320/gm12u320.c diff --git a/MAINTAINERS b/MAINTAINERS index e2db0d467966..754d884eb26b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5025,6 +5025,11 @@ S: Maintained F:drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c F: Documentation/devicetree/bindings/display/panel/feiyang,fy07024di26a30d.txt +DRM DRIVER FOR GRAIN MEDIA GM12U320 PROJECTORS +M: Hans de Goede I assume this will be a drm-misc driver: T: git git://anongit.freedesktop.org/drm/drm-misc Ack, will fix for v2. +S: Maintained +F: drivers/gpu/drm/gm12u320/ + DRM DRIVER FOR ILITEK ILI9225 PANELS M:David Lechner S:Maintained diff --git a/drivers/gpu/drm/gm12u320/gm12u320.c b/drivers/gpu/drm/gm12u320/gm12u320.c new file mode 100644 index ..ccbbd62f444d --- /dev/null +++ b/drivers/gpu/drm/gm12u320/gm12u320.c +static void gm12u320_pipe_update(struct drm_simple_display_pipe *pipe, +struct drm_plane_state *old_state) +{ + struct drm_plane_state *state = pipe->plane.state; + struct drm_crtc *crtc = &pipe->crtc; + struct drm_rect rect; + + if (drm_atomic_helper_damage_merged(old_state, state, &rect)) + gm12u320_fb_mark_dirty(pipe->plane.state->fb, &rect); I'm about to write a usb display driver myself, so I'm curious about why you punt off the update to a worker instead of doing the update inline? There are 2 reasons: 1) Doing the update inline is going to take a while, where as userspace desktop code expects the flip to be nearly instant, so if we block long here we are introducing significant latency to various userspace code paths which is undesirable. 2) The hardware in question falls back to showing a builtin screen with driver installation instruction if you do not send it a new frame every 2 seconds. So if a desktop environment is smart (energy consumption aware) enough to not re-render needlessly and the user is just sitting there watching at the screen (so the ui is idle), then without the worker we will get this driver install screen after 2 seconds instead of the desktop. This is also why the loop in the worker uses wait_event_timeout() instead of plain wait_event() Interesting that you are working on an usb display driver, can you share for which hardware this is? A couple of years ago (around the time I posted the first version of a driver for the gm12u320) I started this side project to add support for some video over USB devices. I have hardware for; and eventually hope to add kms support for the following: -Fresco Logic FL2000 chip out of tree driver here: https://github.com/FrescoLogic/FL2000 This one is used in manycheap USB3 (A connector) to VGA dongles -xf86-video-sisusb supported devices -Philips PicoPix PPX2055 libam7xxx / am7xxx based devices: https://git.ao2.it/libam7xxx.git/ If you happen to be working on support for one of those, please let me know so I can avoid doing double work. I hope that now that I've found some time to properly tackle the gm12u320 case I'll also find time for some of these other soonish. The simple pipe stuff is really nice and makes working on this a lot easier, so I'm certainly motivated to spend some of my spare time on this now :) + + if (crtc->state->event) { + spin_lock_irq(&crtc->dev->event_lock); + drm_crtc_send_vblank_event(crtc, crtc->state->event); + crtc->state->event = NULL; + spin_unlock_irq(&crtc->dev->event_lock); + } +} + +static const struct drm_simple_display_pipe_funcs gm12u320_pipe_funcs = { + .enable = gm12u320_pipe_enable, + .di
Re: [PATCH 09/10] drm/tinydrm/mipi-dbi: Add mipi_dbi_init_with_formats()
On 7/17/19 6:58 AM, Noralf Trønnes wrote: The MIPI DBI standard support more pixel formats than what this helper supports. Add an init function that lets the driver use different format(s). This avoids open coding mipi_dbi_init() in st7586. st7586 sets preferred_depth but this is not necessary since it only supports one format. Although that might not always be the case. FYI, we are finding that having XRGB for a 2bpp grayscale display is not the greatest. When we want to do direct drawing on the screen, we haven't found very good support in existing graphics libraries for embedded systems for this format. If I had more free time, I would like to look at adding grayscale support to DRM. Cc: David Lechner Signed-off-by: Noralf Trønnes --- Acked-by: David Lechner ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 10/10] drm/tinydrm: Move tinydrm_display_pipe_init() to mipi-dbi
On 7/17/19 6:58 AM, Noralf Trønnes wrote: tinydrm_display_pipe_init() has only one user now, so move it to mipi-dbi. Changes: - Remove drm_connector_helper_funcs.detect, it's always connected. - Store the connector and mode in mipi_dbi instead of it's own struct. Otherwise remove some leftover tinydrm-helpers.h inclusions. Were the uses of tinydrm-helpers.h removed in this series? If so, then th #include should probably be removed at the same time. If not, removing the #include lines could just be an independent patch from this series. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm/vgem: fix cache synchronization on arm/arm64
From: Rob Clark drm_cflush_pages() is no-op on arm/arm64. But instead we can use dma_sync API. Fixes failures w/ vgem_test. Signed-off-by: Rob Clark --- An alternative approach to the series[1] I sent yesterday On the plus side, it keeps the WC buffers and avoids any drm core changes. On the minus side, I don't think it will work (at least on arm64) prior to v5.0[2], so the fix can't be backported very far. [1] https://patchwork.freedesktop.org/series/63771/ [2] depends on 356da6d0cde3323236977fce54c1f9612a742036 drivers/gpu/drm/vgem/vgem_drv.c | 130 1 file changed, 83 insertions(+), 47 deletions(-) diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index 76d95b5e289c..6c9b5e20b3d4 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -47,10 +47,16 @@ static struct vgem_device { struct platform_device *platform; } *vgem_device; +static void sync_and_unpin(struct drm_vgem_gem_object *bo); +static struct page **pin_and_sync(struct drm_vgem_gem_object *bo); + static void vgem_gem_free_object(struct drm_gem_object *obj) { struct drm_vgem_gem_object *vgem_obj = to_vgem_bo(obj); + if (!obj->import_attach) + sync_and_unpin(vgem_obj); + kvfree(vgem_obj->pages); mutex_destroy(&vgem_obj->pages_lock); @@ -78,40 +84,15 @@ static vm_fault_t vgem_gem_fault(struct vm_fault *vmf) return VM_FAULT_SIGBUS; mutex_lock(&obj->pages_lock); + if (!obj->pages) + pin_and_sync(obj); if (obj->pages) { get_page(obj->pages[page_offset]); vmf->page = obj->pages[page_offset]; ret = 0; } mutex_unlock(&obj->pages_lock); - if (ret) { - struct page *page; - - page = shmem_read_mapping_page( - file_inode(obj->base.filp)->i_mapping, - page_offset); - if (!IS_ERR(page)) { - vmf->page = page; - ret = 0; - } else switch (PTR_ERR(page)) { - case -ENOSPC: - case -ENOMEM: - ret = VM_FAULT_OOM; - break; - case -EBUSY: - ret = VM_FAULT_RETRY; - break; - case -EFAULT: - case -EINVAL: - ret = VM_FAULT_SIGBUS; - break; - default: - WARN_ON(PTR_ERR(page)); - ret = VM_FAULT_SIGBUS; - break; - } - } return ret; } @@ -277,32 +258,93 @@ static const struct file_operations vgem_driver_fops = { .release= drm_release, }; -static struct page **vgem_pin_pages(struct drm_vgem_gem_object *bo) +/* Called under pages_lock, except in free path (where it can't race): */ +static void sync_and_unpin(struct drm_vgem_gem_object *bo) { - mutex_lock(&bo->pages_lock); - if (bo->pages_pin_count++ == 0) { - struct page **pages; + struct drm_device *dev = bo->base.dev; + + if (bo->table) { + dma_sync_sg_for_cpu(dev->dev, bo->table->sgl, + bo->table->nents, DMA_BIDIRECTIONAL); + sg_free_table(bo->table); + kfree(bo->table); + bo->table = NULL; + } + + if (bo->pages) { + drm_gem_put_pages(&bo->base, bo->pages, true, true); + bo->pages = NULL; + } +} + +static struct page **pin_and_sync(struct drm_vgem_gem_object *bo) +{ + struct drm_device *dev = bo->base.dev; + int npages = bo->base.size >> PAGE_SHIFT; + struct page **pages; + struct sg_table *sgt; + + WARN_ON(!mutex_is_locked(&bo->pages_lock)); + + pages = drm_gem_get_pages(&bo->base); + if (IS_ERR(pages)) { + bo->pages_pin_count--; + mutex_unlock(&bo->pages_lock); + return pages; + } - pages = drm_gem_get_pages(&bo->base); - if (IS_ERR(pages)) { - bo->pages_pin_count--; - mutex_unlock(&bo->pages_lock); - return pages; - } + sgt = drm_prime_pages_to_sg(pages, npages); + if (IS_ERR(sgt)) { + dev_err(dev->dev, + "failed to allocate sgt: %ld\n", + PTR_ERR(bo->table)); + drm_gem_put_pages(&bo->base, pages, false, false); + mutex_unlock(&bo->pages_lock); + return ERR_CAST(bo->table); + } + + /* +* Flush the object from the CPU cache so th
Re: [v5 1/7] drm/mediatek: move mipi_dsi_host_register to probe
On Thu, Jun 27, 2019 at 11:11 PM CK Hu wrote: > > Hi, Jitao: > > On Thu, 2019-06-27 at 16:01 +0800, Jitao Shi wrote: > > DSI panel driver need attach function which is inculde in > > mipi_dsi_host_ops. > > > > If mipi_dsi_host_register is not in probe, dsi panel will > > probe more delay. > > > > So move the mipi_dsi_host_register to probe from bind. > > > > Signed-off-by: Jitao Shi > > Reviewed-by: CK Hu > > This version is different than v4, so please remove reviewed-by tag when > this patch change. When I see a reviewed-by tag of mine, I would just > skip review it again because I assume this patch is the same as previous > version. > > For this version, I give still give it a > > Reviewed-by: CK Hu > > > --- > > drivers/gpu/drm/mediatek/mtk_dsi.c | 53 +- > > 1 file changed, 31 insertions(+), 22 deletions(-) > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c > > b/drivers/gpu/drm/mediatek/mtk_dsi.c > > index b00eb2d2e086..595b3b047c7b 100644 > > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > > @@ -528,7 +528,7 @@ static s32 mtk_dsi_switch_to_cmd_mode(struct mtk_dsi > > *dsi, u8 irq_flag, u32 t) > > > > static int mtk_dsi_poweron(struct mtk_dsi *dsi) > > { > > - struct device *dev = dsi->dev; > > + struct device *dev = dsi->->host.dev; single -> here > > int ret; > > u64 pixel_clock, total_bits; > > u32 htotal, htotal_bits, bit_per_pixel, overhead_cycles, > > overhead_bits; > > @@ -1045,12 +1045,6 @@ static int mtk_dsi_bind(struct device *dev, struct > > device *master, void *data) > > return ret; > > } > > > > - ret = mipi_dsi_host_register(&dsi->host); > > - if (ret < 0) { > > - dev_err(dev, "failed to register DSI host: %d\n", ret); > > - goto err_ddp_comp_unregister; > > - } > > - > > ret = mtk_dsi_create_conn_enc(drm, dsi); > > if (ret) { > > DRM_ERROR("Encoder create failed with %d\n", ret); > > @@ -1060,8 +1054,6 @@ static int mtk_dsi_bind(struct device *dev, struct > > device *master, void *data) > > return 0; > > > > err_unregister: > > - mipi_dsi_host_unregister(&dsi->host); > > -err_ddp_comp_unregister: > > mtk_ddp_comp_unregister(drm, &dsi->ddp_comp); > > return ret; > > } > > @@ -1073,7 +1065,6 @@ static void mtk_dsi_unbind(struct device *dev, struct > > device *master, > > struct mtk_dsi *dsi = dev_get_drvdata(dev); > > > > mtk_dsi_destroy_conn_enc(dsi); > > - mipi_dsi_host_unregister(&dsi->host); > > mtk_ddp_comp_unregister(drm, &dsi->ddp_comp); > > } > > > > @@ -1097,31 +1088,36 @@ static int mtk_dsi_probe(struct platform_device > > *pdev) > > > > dsi->host.ops = &mtk_dsi_ops; > > dsi->host.dev = dev; > > + ret = mipi_dsi_host_register(&dsi->host); > > + if (ret < 0) { > > + dev_err(dev, "failed to register DSI host: %d\n", ret); > > + return ret; > > + } > > > > ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, > > &dsi->panel, &dsi->bridge); > > if (ret) > > - return ret; > > + goto err_unregister_host; > > > > dsi->engine_clk = devm_clk_get(dev, "engine"); > > if (IS_ERR(dsi->engine_clk)) { > > ret = PTR_ERR(dsi->engine_clk); > > dev_err(dev, "Failed to get engine clock: %d\n", ret); > > - return ret; > > + goto err_unregister_host; > > } > > > > dsi->digital_clk = devm_clk_get(dev, "digital"); > > if (IS_ERR(dsi->digital_clk)) { > > ret = PTR_ERR(dsi->digital_clk); > > dev_err(dev, "Failed to get digital clock: %d\n", ret); > > - return ret; > > + goto err_unregister_host; > > } > > > > dsi->hs_clk = devm_clk_get(dev, "hs"); > > if (IS_ERR(dsi->hs_clk)) { > > ret = PTR_ERR(dsi->hs_clk); > > dev_err(dev, "Failed to get hs clock: %d\n", ret); > > - return ret; > > + goto err_unregister_host; > > } > > > > regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); > > @@ -1129,33 +1125,35 @@ static int mtk_dsi_probe(struct platform_device > > *pdev) > > if (IS_ERR(dsi->regs)) { > > ret = PTR_ERR(dsi->regs); > > dev_err(dev, "Failed to ioremap memory: %d\n", ret); > > - return ret; > > + goto err_unregister_host; > > } > > > > dsi->phy = devm_phy_get(dev, "dphy"); > > if (IS_ERR(dsi->phy)) { > > ret = PTR_ERR(dsi->phy); > > dev_err(dev, "Failed to get MIPI-DPHY: %d\n", ret); > > - return ret; > > + goto err_unregister_host; > > } > > > > comp_id = mtk_ddp_comp_get_id(dev->of_node, MTK_DSI); > > if (comp_id < 0) { > > dev_err(dev, "Failed to identify by ali
Re: [PATCH v1 05/33] drm/mxsfb: drop use of drmP.h
On 2019-07-15 18:28, Sam Ravnborg wrote: > On Fri, Jul 05, 2019 at 10:47:30PM +0200, Stefan Agner wrote: >> On 2019-06-30 08:18, Sam Ravnborg wrote: >> > Drop use of the deprecated drmP.h header file. >> > >> > While touching the list of include files divided them >> > in blocks and sort them within each block. >> > Fixed fallout in the relevant files. >> > >> > Signed-off-by: Sam Ravnborg >> > Cc: Marek Vasut >> > Cc: Stefan Agner >> > Cc: David Airlie >> > Cc: Daniel Vetter >> > Cc: Shawn Guo >> > Cc: Sascha Hauer >> > Cc: Pengutronix Kernel Team >> > Cc: Fabio Estevam >> > Cc: NXP Linux Team >> > Cc: linux-arm-ker...@lists.infradead.org >> >> >> Acked-by: Stefan Agner > > Applied, thanks. > > As a strange note, this mail also showed up in my gmail account. > Maybe because I send mails out using gmail but the mail address is not > visible anywhere. Anyway - just a note. In the email I received your gmail was in the header as "Sender", and the other email in "From". Not sure what is the right address to answer to, but it seems that my client chose "Sender"...? -- Stefan ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: next/master boot: 265 boots: 17 failed, 243 passed with 4 offline, 1 conflict (next-20190717)
On Wed, Jul 17, 2019 at 5:10 AM Mark Brown wrote: > > On Wed, Jul 17, 2019 at 04:27:56AM -0700, kernelci.org bot wrote: > > Today's -next fails to boot on a couple of apq8064 boards: > > > arm: > > qcom_defconfig: > > gcc-8: > > qcom-apq8064-cm-qs600: 1 failed lab > > qcom-apq8064-ifc6410: 1 failed lab > > In both cases it looks like the error handling when we fail to get the > firmware for the GPU is broken, we get a crash in the initialization > code shortly after failing to load some firmware: > > [4.608279] msm 510.mdp: Direct firmware load for qcom/a300_pm4.fw > failed with error -2 > [4.614916] msm 510.mdp: [drm:adreno_request_fw] *ERROR* failed to > load a300_pm4.fw > [4.623229] 8<--- cut here --- > [4.63] Unable to handle kernel NULL pointer dereference at virtual > address 0088 > > ... > > [4.665947] Workqueue: events deferred_probe_work_func > [4.670532] PC is at msm_open+0x64/0x90 > [4.675656] LR is at _raw_write_unlock+0x20/0x4c > > ... > > [4.949553] [] (msm_open) from [] (drm_file_alloc+0x134/0x21c) > [4.957703] [] (drm_file_alloc) from [] (drm_client_init+0xa8/0x124) > [4.965162] [] (drm_client_init) from [] > (drm_fb_helper_init.part.0+0x30/0x3c) > [4.973411] [] (drm_fb_helper_init.part.0) from [] > (msm_fbdev_init+0x50/0xb4) > [4.982173] [] (msm_fbdev_init) from [] (msm_drm_bind+0x560/0x638) > > Full details (including full boot logs) at: > > https://kernelci.org/boot/id/5d2ede2359b514a54b49e91b/ > https://kernelci.org/boot/id/5d2ede2759b514a54749e91d/ jfyi, Jordan tracked this down to needing: https://patchwork.freedesktop.org/patch/314397/ BR, -R ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [v5 6/7] drm/mediatek: change the dsi phytiming calculate method
On Sun, Jun 30, 2019 at 6:43 PM CK Hu wrote: > > Hi, Jitao: > > On Thu, 2019-06-27 at 16:01 +0800, Jitao Shi wrote: > > Change the method of frame rate calc which can get more accurate > > frame rate. > > > > data rate = pixel_clock * bit_per_pixel / lanes > > Adjust hfp_wc to adapt the additional phy_data > > > > if MIPI_DSI_MODE_VIDEO_BURST > > hfp_wc = hfp * bpp - data_phy_cycles * lanes - 12 - 6; > > else > > hfp_wc = hfp * bpp - data_phy_cycles * lanes - 12; > > > > Note: > > //(2: 1 for sync, 1 for phy idle) > > data_phy_cycles = T_hs_exit + T_lpx + T_hs_prepare + T_hs_zero + 2; > > > > bpp: bit per pixel > > > > Signed-off-by: Jitao Shi > > Tested-by: Ryan Case > > Reviewed-by: CK Hu > > This version is different than previous version, so you should remove > Reviewed-by tag. For this version, I still give you a > > Reviewed-by: CK Hu > > > --- > > drivers/gpu/drm/mediatek/mtk_dsi.c | 117 - > > 1 file changed, 80 insertions(+), 37 deletions(-) > > > > diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c > > b/drivers/gpu/drm/mediatek/mtk_dsi.c > > index 1621e8cdacc2..cefdcb1509cb 100644 > > --- a/drivers/gpu/drm/mediatek/mtk_dsi.c > > +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c > > @@ -144,12 +144,6 @@ > > #define DATA_0 (0xff << 16) > > #define DATA_1 (0xff << 24) > > > > -#define T_LPX5 > > -#define T_HS_PREP6 > > -#define T_HS_TRAIL 8 > > -#define T_HS_EXIT7 > > -#define T_HS_ZERO10 > > - > > #define NS_TO_CYCLE(n, c)((n) / (c) + (((n) % (c)) ? 1 : 0)) > > > > #define MTK_DSI_HOST_IS_READ(type) \ > > @@ -158,6 +152,25 @@ > > (type == MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM) || \ > > (type == MIPI_DSI_DCS_READ)) > > > > +struct mtk_phy_timing { > > + u32 lpx; > > + u32 da_hs_prepare; > > + u32 da_hs_zero; > > + u32 da_hs_trail; > > + > > + u32 ta_go; > > + u32 ta_sure; > > + u32 ta_get; > > + u32 da_hs_exit; > > + > > + u32 clk_hs_zero; > > + u32 clk_hs_trail; > > + > > + u32 clk_hs_prepare; > > + u32 clk_hs_post; > > + u32 clk_hs_exit; > > +}; > > + > > struct phy; > > > > struct mtk_dsi_driver_data { > > @@ -188,6 +201,7 @@ struct mtk_dsi { > > enum mipi_dsi_pixel_format format; > > unsigned int lanes; > > struct videomode vm; > > + struct mtk_phy_timing phy_timing; > > int refcount; > > bool enabled; > > u32 irq_data; > > @@ -221,17 +235,36 @@ static void mtk_dsi_phy_timconfig(struct mtk_dsi *dsi) > > { > > u32 timcon0, timcon1, timcon2, timcon3; > > u32 ui, cycle_time; > > + struct mtk_phy_timing *timing = &dsi->phy_timing; > > + > > + ui = 10 / dsi->data_rate; > > + cycle_time = div_u64(80ULL, dsi->data_rate); > > + > > + timing->lpx = NS_TO_CYCLE(60, cycle_time); > > + timing->da_hs_prepare = NS_TO_CYCLE(40 + 5 * ui, cycle_time); > > + timing->da_hs_zero = NS_TO_CYCLE(110 + 6 * ui, cycle_time); > > + timing->da_hs_trail = NS_TO_CYCLE(80 + 4 * ui, cycle_time); > > > > - ui = 1000 / dsi->data_rate + 0x01; > > - cycle_time = 8000 / dsi->data_rate + 0x01; > > + timing->ta_go = 4 * timing->lpx; > > + timing->ta_sure = 3 * timing->lpx / 2; > > + timing->ta_get = 5 * timing->lpx; > > + timing->da_hs_exit = 2 * timing->lpx; > > > > - timcon0 = T_LPX | T_HS_PREP << 8 | T_HS_ZERO << 16 | T_HS_TRAIL << 24; > > - timcon1 = 4 * T_LPX | (3 * T_LPX / 2) << 8 | 5 * T_LPX << 16 | > > - T_HS_EXIT << 24; > > - timcon2 = ((NS_TO_CYCLE(0x64, cycle_time) + 0xa) << 24) | > > - (NS_TO_CYCLE(0x150, cycle_time) << 16); > > - timcon3 = NS_TO_CYCLE(0x40, cycle_time) | (2 * T_LPX) << 16 | > > - NS_TO_CYCLE(80 + 52 * ui, cycle_time) << 8; > > + timing->clk_hs_zero = NS_TO_CYCLE(336, cycle_time); > > + timing->clk_hs_trail = NS_TO_CYCLE(100, cycle_time) + 10; > > + > > + timing->clk_hs_prepare = NS_TO_CYCLE(64, cycle_time); > > + timing->clk_hs_post = NS_TO_CYCLE(80 + 52 * ui, cycle_time); > > + timing->clk_hs_exit = 2 * timing->lpx; > > + > > + timcon0 = timing->lpx | timing->da_hs_prepare << 8 | > > + timing->da_hs_zero << 16 | timing->da_hs_trail << 24; > > + timcon1 = timing->ta_go | timing->ta_sure << 8 | > > + timing->ta_get << 16 | timing->da_hs_exit << 24; > > + timcon2 = 1 << 8 | timing->clk_hs_zero << 16 | > > + timing->clk_hs_trail << 24; > > + timcon3 = timing->clk_hs_prepare | timing->clk_hs_post << 8 | > > + timing->clk_hs_exit << 16; > > > > writel(timcon0, dsi->regs + DSI_PHY_TIMECON0); > > writel(timcon1, dsi->regs + DSI_PHY_TIMECON1); > > @@ -418,7 +451,8 @@ static void mtk_dsi_config_vdo_timing(struct mtk_dsi > > *dsi) > > u32 horizontal_sync_active_byte; > > u32 horizontal_backporch_byte; > > u32 horizontal_f
[Bug 204145] amdgpu video playback causes host to hard reset (checkstop) on POWER9 with RX 580
https://bugzilla.kernel.org/show_bug.cgi?id=204145 Robert Bridge (rob...@robbieab.com) changed: What|Removed |Added CC||rob...@robbieab.com --- Comment #20 from Robert Bridge (rob...@robbieab.com) --- I was encountering a bug showing similar symptoms with a different trigger: For me, any attempt to play sound consistently and immediately crashed my system. This was not the case with the 4.20 kernel, was confirmed happening with the 5.1 kernel. git bisection identified the same patch Timothy has identified as the patch introducing the issue for me. I can confirm that the patch provided by Shawn appears to fix the issue. Building a kernel with that patch applied to head (commit 22051d9c4a57d3b4a8b5a7407efc80c71c7bfb16) from linux.git provides me with a kernel that no longer crashes when I attempt to play sound. -- 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
[Bug 204145] amdgpu video playback causes host to hard reset (checkstop) on POWER9 with RX 580
https://bugzilla.kernel.org/show_bug.cgi?id=204145 --- Comment #21 from Timothy Pearson (tpear...@raptorengineering.com) --- Patch #3 confirmed working when applied against kernel 5.2.1. Thanks Shawn! -- 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
[Bug 204145] amdgpu video playback causes host to hard reset (checkstop) on POWER9 with RX 580
https://bugzilla.kernel.org/show_bug.cgi?id=204145 --- Comment #22 from Shawn Anastasio (sh...@anastas.io) --- Great! I've posted the patch to the linuxppc-dev mailing list here: https://patchwork.ozlabs.org/patch/1133466/. -- 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
[Bug 204145] amdgpu video playback causes host to hard reset (checkstop) on POWER9 with RX 580
https://bugzilla.kernel.org/show_bug.cgi?id=204145 --- Comment #23 from Timothy Pearson (tpear...@raptorengineering.com) --- A nit, but might want to mark this bug as a regression and update the kernel version to 5.2.1? -- 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
[Bug 204145] amdgpu video playback causes host to hard reset (checkstop) on POWER9 with RX 580
https://bugzilla.kernel.org/show_bug.cgi?id=204145 Shawn Anastasio (sh...@anastas.io) changed: What|Removed |Added Component|Video(DRI - non Intel) |PPC-64 Kernel Version|5.1.15 |5.2.1 Product|Drivers |Platform Specific/Hardware Regression|No |Yes -- 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
[Bug 204145] amdgpu video playback causes host to hard reset (checkstop) on POWER9 with RX 580
https://bugzilla.kernel.org/show_bug.cgi?id=204145 --- Comment #24 from Shawn Anastasio (sh...@anastas.io) --- Done. I've also updated the product/component to Platform Specific/PPC-64 since this wasn't an issue with amdgpu after all. -- 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