Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7-0]: src/sys/external/bsd/drm2/dist/drm Pull up following revisi...



details:   https://anonhg.NetBSD.org/src/rev/ba23bf0c4ed5
branches:  netbsd-7-0
changeset: 801239:ba23bf0c4ed5
user:      snj <snj%NetBSD.org@localhost>
date:      Wed Nov 16 18:30:55 2016 +0000

description:
Pull up following revision(s) (requested by maya in ticket #1272):
        sys/external/bsd/drm2/dist/drm/drm_gem.c: revision 1.6
Avoid zero-size uao.
Apparently some GEM/TTM objects can be zero-size, as discovered by
Stefan Hertenberger:
https://mail-index.netbsd.org/current-users/2016/08/02/msg029891.html

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_gem.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (16 lines):

diff -r ed6583f5152b -r ba23bf0c4ed5 sys/external/bsd/drm2/dist/drm/drm_gem.c
--- a/sys/external/bsd/drm2/dist/drm/drm_gem.c  Wed Nov 16 08:37:15 2016 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_gem.c  Wed Nov 16 18:30:55 2016 +0000
@@ -154,7 +154,11 @@
        drm_gem_private_object_init(dev, obj, size);
 
 #ifdef __NetBSD__
-       obj->gemo_shm_uao = uao_create(size, 0);
+       /*
+        * A uao may not have size 0, but a gem object may.  Allocate a
+        * spurious page so we needn't teach uao how to have size 0.
+        */
+       obj->gemo_shm_uao = uao_create(MAX(size, PAGE_SIZE), 0);
        /*
         * XXX This is gross.  We ought to do it the other way around:
         * set the uao to have the main uvm object's lock.  However,



Home | Main Index | Thread Index | Old Index