Panic booting qemu-system-sparc64 with bochs_drm

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Mon Jul 6 19:36:48 UTC 2020


On 04/07/2020 15:52, Sam Ravnborg wrote:

> Hi Mark.
> 
> On Sat, Jul 04, 2020 at 03:16:47PM +0100, Mark Cave-Ayland wrote:
>> On 04/07/2020 14:41, Sam Ravnborg wrote:
>>
>>> I think what is happening is that the bochs driver request a shadow copy
>>> for the frambuffer. And with the change to fbops we now use the cfb_
>>> functions to write to the shadow framebuffer - which is not in any IO
>>> space. So this does not work.
>>>
>>> So maybe all we need is the fix in drm_fb_helper_dirty_blit_real().
>>> If you try to undo the change so fbops is set to &drm_fbdev_fb_ops,
>>> but keep the fix in drm_fb_helper_dirty_blit_real() how does it then
>>> behave?
>>
>> Bingo! I just tried that and the framebuffer is now working under qemu-system-sparc64
>> again - thank you so much for the help! From what you said I guess
>> drm_fb_helper_dirty_blit_real() is responsible syncing the shadow copy?
>>
>> Below is the current working diff based upon your previous one: it certainly feels
>> like the difference in memcpy() behaviour should be hidden away in fb_memcpy_tofb()
>> or similar.
> 
>>From your feedback so far I thnk the minimal fix would be like this:
> 
>> --- a/drivers/gpu/drm/drm_fb_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_helper.c
>> .. static void drm_fb_helper_dirty_blit_real(struct drm_fb_helper *fb_helper,
>>         size_t len = (clip->x2 - clip->x1) * cpp;
>>         unsigned int y;
>>
>>         for (y = clip->y1; y < clip->y2; y++) {
>> -               memcpy(dst, src, len);
>> +               fb_memcpy_tofb(dst, src, len);
>>                 src += fb->pitches[0];
>>                 dst += fb->pitches[0];
>>         }
> 
> (Hand edited, patch s not a valid syntax)
> 
> But I need feedback from someone that know all this a bit better
> to judge if this is an OK change.
> For once - this will only work with shadow buffers.

Hi Sam,

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);
                src += fb->pitches[0];
                dst += fb->pitches[0];
        }

I guess that the next step is to wait for advice from Gerd as to whether this is
sufficient, or if other changes are required to allow non-shadow buffers to work on
architectures similar to SPARC64 too.


ATB,

Mark.


More information about the dri-devel mailing list