Panic booting qemu-system-sparc64 with bochs_drm

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Tue Jul 7 16:17:17 UTC 2020


On 07/07/2020 08:03, Gerd Hoffmann wrote:

>> Yes, that's correct - I can confirm that the simplified diff below works:
>>
>> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
>> index 5609e164805f..83af05fac604 100644
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> @@ -399,7 +399,7 @@ static void drm_fb_helper_dirty_blit_real(struct drm_fb_helper
>> *fb_helper,
>>         unsigned int y;
>>
>>         for (y = clip->y1; y < clip->y2; y++) {
>> -               memcpy(dst, src, len);
>> +               fb_memcpy_tofb(dst, src, len);
> 
> fb_memcpy_tofb is #defined to sbus_memcpy_toio @ sparc which looks
> wrong to me given that this is a pci not a sbus device.  sparc also has
> memcpy_toio which looks better to me.
> 
> There are blit helpers in drm_format_helper.c which already use
> memcpy_toio(), I guess we should do the same here.  Not fully sure we
> can use memcpy_toio() unconditionally here.  Given that a shadow
> framebuffer makes sense only in case the real framebuffer is not in
> normal ram we probably can.

Thanks Gerd - I've just tested the diff below with memcpy_toio() and that works too:

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 5609e164805f..4d05b0ab1592 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -399,7 +399,7 @@ static void drm_fb_helper_dirty_blit_real(struct drm_fb_helper
*fb_helper,
        unsigned int y;

        for (y = clip->y1; y < clip->y2; y++) {
-               memcpy(dst, src, len);
+               memcpy_toio(dst, src, len);
                src += fb->pitches[0];
                dst += fb->pitches[0];
        }

Presumably there is some existing mechanism that ensures SPARC will always choose a
shadow framebuffer?


ATB,

Mark.


More information about the dri-devel mailing list