vm_page_hold() and drm-legacy-kmod

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

vm_page_hold() and drm-legacy-kmod

Steve Kargl
It seems the recent flurry of vm commits has
broken the graphics/drm-legacy-kmod port.
vm_page_hold() no longer exists.  How do I
fix the port?

--
Steve
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: vm_page_hold() and drm-legacy-kmod

Steve Kargl
On Mon, Jul 08, 2019 at 09:31:12PM -0700, Steve Kargl wrote:
> It seems the recent flurry of vm commits has
> broken the graphics/drm-legacy-kmod port.
> vm_page_hold() no longer exists.  How do I
> fix the port?
>

Whoops.  The missing function is vm_page_unhold().
Anywhoo, how do I fix this?

--
Steve
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: vm_page_hold() and drm-legacy-kmod

Steve Kargl
On Mon, Jul 08, 2019 at 09:35:05PM -0700, Steve Kargl wrote:

> On Mon, Jul 08, 2019 at 09:31:12PM -0700, Steve Kargl wrote:
> > It seems the recent flurry of vm commits has
> > broken the graphics/drm-legacy-kmod port.
> > vm_page_hold() no longer exists.  How do I
> > fix the port?
> >
>
> Whoops.  The missing function is vm_page_unhold().
> Anywhoo, how do I fix this?
>
The code in question is

        for (i = 0; i < vsg->num_pages; i++) {                                  
                m = vsg->pages[i];                                              
                vm_page_lock(m);                                                
                vm_page_wire(m);                                                
                vm_page_unhold(m);                                              
                vm_page_unlock(m);                                              
        }                                                                      

--
Steve
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: vm_page_hold() and drm-legacy-kmod

Steve Kargl
On Mon, Jul 08, 2019 at 09:43:36PM -0700, Steve Kargl wrote:

> On Mon, Jul 08, 2019 at 09:35:05PM -0700, Steve Kargl wrote:
> > On Mon, Jul 08, 2019 at 09:31:12PM -0700, Steve Kargl wrote:
> > > It seems the recent flurry of vm commits has
> > > broken the graphics/drm-legacy-kmod port.
> > > vm_page_hold() no longer exists.  How do I
> > > fix the port?
> > >
> >
> > Whoops.  The missing function is vm_page_unhold().
> > Anywhoo, how do I fix this?
> >
> The code in question is
>
>         for (i = 0; i < vsg->num_pages; i++) {
>                 m = vsg->pages[i];
>                 vm_page_lock(m);
>                 vm_page_wire(m);
>                 vm_page_unhold(m);
>                 vm_page_unlock(m);
>         }

This was broken by r349846 committed by markj.

--
Steve
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: vm_page_hold() and drm-legacy-kmod

Mark Johnston-2
On Mon, Jul 08, 2019 at 10:04:00PM -0700, Steve Kargl wrote:

> On Mon, Jul 08, 2019 at 09:43:36PM -0700, Steve Kargl wrote:
> > On Mon, Jul 08, 2019 at 09:35:05PM -0700, Steve Kargl wrote:
> > > On Mon, Jul 08, 2019 at 09:31:12PM -0700, Steve Kargl wrote:
> > > > It seems the recent flurry of vm commits has
> > > > broken the graphics/drm-legacy-kmod port.
> > > > vm_page_hold() no longer exists.  How do I
> > > > fix the port?
> > > >
> > >
> > > Whoops.  The missing function is vm_page_unhold().
> > > Anywhoo, how do I fix this?
> > >
> > The code in question is
> >
> >         for (i = 0; i < vsg->num_pages; i++) {
> >                 m = vsg->pages[i];
> >                 vm_page_lock(m);
> >                 vm_page_wire(m);
> >                 vm_page_unhold(m);
> >                 vm_page_unlock(m);
> >         }
>
> This was broken by r349846 committed by markj.

Please try this patch.  If it works for you I will submit a pull request
to the drm-legacy repo.

diff --git a/src/dev/drm/via_dmablit.c b/src/dev/drm/via_dmablit.c
index e8096f2..aa57944 100644
--- a/src/dev/drm/via_dmablit.c
+++ b/src/dev/drm/via_dmablit.c
@@ -222,8 +222,10 @@ static int
 via_lock_all_dma_pages(drm_via_sg_info_t *vsg,  drm_via_dmablit_t *xfer)
 {
  unsigned long first_pfn = VIA_PFN(xfer->mem_addr);
+#if __FreeBSD_version < 1300035
  vm_page_t m;
  int i;
+#endif
 
  vsg->num_pages = VIA_PFN(xfer->mem_addr +
     (xfer->num_lines * xfer->mem_stride -1)) - first_pfn + 1;
@@ -239,6 +241,7 @@ via_lock_all_dma_pages(drm_via_sg_info_t *vsg,  drm_via_dmablit_t *xfer)
     VM_PROT_READ | VM_PROT_WRITE, vsg->pages, vsg->num_pages) < 0)
  return -EACCES;
 
+#if __FreeBSD_version < 1300035
  for (i = 0; i < vsg->num_pages; i++) {
  m = vsg->pages[i];
  vm_page_lock(m);
@@ -246,6 +249,7 @@ via_lock_all_dma_pages(drm_via_sg_info_t *vsg,  drm_via_dmablit_t *xfer)
  vm_page_unhold(m);
  vm_page_unlock(m);
  }
+#endif
  vsg->state = dr_via_pages_locked;
 
  DRM_DEBUG("DMA pages locked\n");
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: vm_page_hold() and drm-legacy-kmod

Steve Kargl
On Tue, Jul 09, 2019 at 01:43:42AM -0400, Mark Johnston wrote:
> On Mon, Jul 08, 2019 at 10:04:00PM -0700, Steve Kargl wrote:
> >
> > This was broken by r349846 committed by markj.
>
> Please try this patch.  If it works for you I will submit a pull request
> to the drm-legacy repo.

Thanks for the quick reply.  I've managed to get my /usr/include
in an inconsistent state in trying to back out 349846.  Currently,
rebuilding the kernel after a 'make includes'.  I'll try your
patch and get back to you.

--
Steve
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: vm_page_hold() and drm-legacy-kmod

Steve Kargl
On Mon, Jul 08, 2019 at 10:57:41PM -0700, Steve Kargl wrote:

> On Tue, Jul 09, 2019 at 01:43:42AM -0400, Mark Johnston wrote:
> > On Mon, Jul 08, 2019 at 10:04:00PM -0700, Steve Kargl wrote:
> > >
> > > This was broken by r349846 committed by markj.
> >
> > Please try this patch.  If it works for you I will submit a pull request
> > to the drm-legacy repo.
>
> Thanks for the quick reply.  I've managed to get my /usr/include
> in an inconsistent state in trying to back out 349846.  Currently,
> rebuilding the kernel after a 'make includes'.  I'll try your
> patch and get back to you.
>

Mark, your patch fixes the problem.  Thanks again for quick response.

After commenting out the line containing iicbus_set_nonstop(),
the port builds and works.

--
Steve
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[hidden email]"