All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: dri-devel@lists.freedesktop.org, Liviu Dudau <Liviu.Dudau@arm.com>
Subject: Re: Assistance with a problem related to GEM and Atomic Commit inside vkms
Date: Fri, 5 Apr 2019 18:42:31 +0300	[thread overview]
Message-ID: <20190405154231.GM3888@intel.com> (raw)
In-Reply-To: <20190403193511.4waspuspncu7xrn7@smtp.gmail.com>

On Wed, Apr 03, 2019 at 04:35:11PM -0300, Rodrigo Siqueira wrote:
> Hi,
> 
> I’m working to add writeback support to vkms; you can see my current
> patch at the end of this email (some prints highlight the issue that I’m
> asking for help here). I’m using the Liviu Dudau and Brian Starkey IGT
> patchset, which can be seen here:
> https://patchwork.freedesktop.org/series/39229/. 
> 
> I’m stuck with a problem that happens in my vkms_wb_atomic_commit()
> function, which is a helper function at  drm_connector_helper_funcs. You
> can see the full implementation of this function at the end of this
> email, but here is the important part:
> 
>   struct drm_framebuffer *fb = conn_state->writeback_job->fb;
>   struct drm_gem_object *gem_obj = drm_gem_fb_get_obj(fb, 0);
>   struct vkms_gem_object *vkms_obj = drm_gem_to_vkms_gem(gem_obj);
> 
> A few lines after this variable initialization, I try to make a memory
> copy like this:
> 
>   memcpy(vkms_conn->writeback_vaddr, vkms_obj->vaddr, vkms_obj->gem.size);
> 
> If I test my implementation with the subtest writeback-fb-id, everything
> work as expected; for extra details, this is the dmesg output after this
> test and with a debug print:
> 
> => writeback-fb-id
> 
> [Apr 3 11:30] CIFS: Attempting to mount //10.0.2.4/qemu
> [  +1.601900] Console: switching to colour dummy device 80x25
> [  +0.000017] [IGT] kms_writeback: executing
> [  +0.032532] [IGT] kms_writeback: starting subtest writeback-fb-id
> [  +0.001932] VKMS_OBJ (1): Buff (1) - Vaddr (1) - Size = 1228800 - count = 1
> [  +0.050524] [IGT] kms_writeback: exiting, ret=0
> [  +0.005202] Console: switching to colour frame buffer device 100x37
> 
> In the above log, you can see the print info; notice that Vaddr is the
> output of vkms_obj->vaddr (Vaddr -> vkms_obj->vaddr != NULL). On the
> other hand, if I try the subtest writeback-check-output, something weird
> happens in this function. Here is the dmesg output for this test:
> 
> =>  writeback-check-output
> 
> [ +29.911185] Console: switching to colour dummy device 80x25
> [  +0.000017] [IGT] kms_writeback: executing
> [  +0.021289] [IGT] kms_writeback: starting subtest writeback-check-output
> [  +0.016270] VKMS_OBJ (1): Buff (1) - Vaddr (0) - Size = 1228800 - count = 0
> [  +0.000005] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
> [  +0.000004] #PF error: [normal kernel read fault]
> [  +0.000001] PGD 0 P4D 0
> [  +0.000003] Oops: 0000 [#1] PREEMPT SMP PTI
> [  +0.000002] CPU: 3 PID: 426 Comm: kms_writeback Not tainted 5.0.0-VKMS-RULES+ #102
> [  +0.000002] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-20181126_142135-anatol 04/01/2014
> [  +0.000021] RIP: 0010:__memcpy+0x12/0x20
> [  +0.000002] Code: ff 0f 31 48 c1 e2 20 48 09 c2 48 31 d3 e9 79 ff ff ff 90 90 90 90 90 90 0f 1f 44 00 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 <f3> 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 89 d1 f3 a4
> [  +0.000001] RSP: 0018:ffffadaf0098fbd8 EFLAGS: 00010246
> [  +0.000002] RAX: ffff9f1bf5400000 RBX: ffff9f1bfa28df00 RCX: 0000000000025800
> [  +0.000001] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9f1bf5400000
> [  +0.000001] RBP: 0000000000000001 R08: 00000017818788be R09: ffffadaf0098fb60
> [  +0.000001] R10: ffff9f1bfffdc998 R11: ffffffffa25ec401 R12: ffff9f1b777ff430
> [  +0.000001] R13: ffffffffc06558b8 R14: ffffffffc06853c0 R15: ffffffffc0685520
> [  +0.000002] FS:  00007f2862deae80(0000) GS:ffff9f1bfc980000(0000) knlGS:0000000000000000
> [  +0.000001] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [  +0.000001] CR2: 0000000000000000 CR3: 00000000baf6c000 CR4: 00000000000006e0
> [  +0.000004] Call Trace:
> [  +0.000023]  drm_atomic_helper_commit_modeset_enables+0x15d/0x1e0 [drm_kms_helper]
> [  +0.000028]  drm_atomic_helper_commit_tail+0x31/0x60 [drm_kms_helper]
> [  +0.000008]  commit_tail+0x58/0x70 [drm_kms_helper]
> [  +0.000008]  drm_atomic_helper_commit+0x103/0x110 [drm_kms_helper]
> [  +0.000040]  drm_mode_atomic_ioctl+0x829/0x950 [drm]
> [  +0.000012]  ? drm_atomic_set_property+0x960/0x960 [drm]
> [  +0.000029]  drm_ioctl_kernel+0xb2/0xf0 [drm]
> [  +0.000011]  drm_ioctl+0x25f/0x3f0 [drm]
> [  +0.000009]  ? drm_atomic_set_property+0x960/0x960 [drm]
> [  +0.000004]  ? n_tty_open+0xa0/0xa0
> [  +0.000004]  do_vfs_ioctl+0xa4/0x630
> [  +0.000003]  ksys_ioctl+0x60/0x90
> [  +0.000003]  ? ksys_write+0x4f/0xb0
> [  +0.000002]  __x64_sys_ioctl+0x16/0x20
> [  +0.000003]  do_syscall_64+0x5b/0x170
> [  +0.000003]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
> [  +0.000002] RIP: 0033:0x7f286677580b
> [  +0.000001] Code: 0f 1e fa 48 8b 05 55 b6 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff 
> 
> Notice that Vaddr became NULL for some reason that I cannot understand.

Just missing the .prepare_writeback_job() hook?

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2019-04-05 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 19:35 Assistance with a problem related to GEM and Atomic Commit inside vkms Rodrigo Siqueira
2019-04-05 15:20 ` Liviu Dudau
2019-04-05 15:42 ` Ville Syrjälä [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=20190405154231.GM3888@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=rodrigosiqueiramelo@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.