From: Johan Jonker <jbx6244@gmail.com>
To: John Keeping <john@metanate.com>,
Thomas Zimmermann <tzimmermann@suse.de>
Cc: Heiko Stuebner <heiko@sntech.de>,
dri-devel@lists.freedesktop.org, Sandy Huang <hjc@rock-chips.com>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org
Subject: Re: [BUG] [PATCH] drm/rockchip: use generic fbdev setup
Date: Mon, 17 Oct 2022 21:16:03 +0200 [thread overview]
Message-ID: <8d884b80-ea5d-6c91-fef0-a093affb3247@gmail.com> (raw)
In-Reply-To: <Y02mRUuecw2C1i+h@donbot>
On 10/17/22 21:00, John Keeping wrote:
> On Mon, Oct 17, 2022 at 08:30:23PM +0200, Johan Jonker wrote:
>>
>>
>> On 10/17/22 13:29, Heiko Stuebner wrote:
>>> Am Montag, 17. Oktober 2022, 12:05:16 CEST schrieb John Keeping:
>>>> Hi Johan,
>>>>
>>>> On Mon, Oct 17, 2022 at 10:11:32AM +0200, Johan Jonker wrote:
>>>>> Your patch contribution causes a kernel panic on MK808 with Rockchip rk3066a SoC.
>>>>> Would you like to contribute to fix this issue?
>>>>> The assumtion that drm_fbdev_generic_setup() does what rockchip_drm_fbdev_init did is not true!
>>>>> A revert makes it work again.
>>>>
>>
>>>> It looks like there are 3 different ways to end up with -ENOMEM here,
>>>> can you track down whether you're hitting one of the cases in
>>>> rockchip_gem_prime_vmap() or if it's the iosys_map_is_null case in
>>>> drm_gem_vmap()?
>>
>> It looks like it comes from rockchip_gem_prime_vmap() second return (2).
>>
>>
>> if (rk_obj->dma_attrs & DMA_ATTR_NO_KERNEL_MAPPING) {
>>
>> ////////////////
>>
>> printk("FBDEV rockchip_gem_prime_vmap 2");
>>
>> ////////////////
>> return -ENOMEM;
>> }
>
> Ah-ha, Heiko was right that this is because the no-iommu path is broken
> as a result of switching to the generic fbdev code.
>
> This patch should fix it, but I wonder if Thomas has any ideas about a
> better way to handle this since it feels a bit hacky to special-case the
> fb_helper inside the GEM code:
The penguin is back on screen. Thanks!
>
> -- >8 --
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> index 614e97aaac80..da8a69953706 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c
> @@ -364,9 +364,12 @@ rockchip_gem_create_with_handle(struct drm_file *file_priv,
> {
> struct rockchip_gem_object *rk_obj;
> struct drm_gem_object *obj;
> + bool is_framebuffer;
> int ret;
>
> - rk_obj = rockchip_gem_create_object(drm, size, false);
> + is_framebuffer = drm->fb_helper && file_priv == drm->fb_helper->client.file;
> +
> + rk_obj = rockchip_gem_create_object(drm, size, is_framebuffer);
> if (IS_ERR(rk_obj))
> return ERR_CAST(rk_obj);
> -- 8< --
prev parent reply other threads:[~2022-10-17 19:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-29 11:50 John Keeping
2021-10-29 19:00 ` Thomas Zimmermann
2021-10-30 12:05 ` John Keeping
2021-10-31 18:09 ` Thomas Zimmermann
2021-11-01 11:34 ` John Keeping
2021-12-07 11:54 ` John Keeping
2021-12-07 13:00 ` Thomas Zimmermann
2022-10-17 8:11 ` [BUG] " Johan Jonker
2022-10-17 10:05 ` John Keeping
2022-10-17 11:29 ` Heiko Stuebner
2022-10-17 18:30 ` Johan Jonker
2022-10-17 19:00 ` John Keeping
2022-10-17 19:16 ` Johan Jonker [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8d884b80-ea5d-6c91-fef0-a093affb3247@gmail.com \
--to=jbx6244@gmail.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=john@metanate.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®