diff options
author | kib <kib@FreeBSD.org> | 2017-03-28 06:07:59 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2017-03-28 06:07:59 +0000 |
commit | 2a317bc917832a4b40c4b69aa496672156144bda (patch) | |
tree | 75d92e88cf5389c711dedc7e5fb80466fc294fda /sys/dev | |
parent | e8aa125d464be1f250b75f43986fc93a25dfad86 (diff) | |
download | FreeBSD-src-2a317bc917832a4b40c4b69aa496672156144bda.zip FreeBSD-src-2a317bc917832a4b40c4b69aa496672156144bda.tar.gz |
MFC r315281:
Use atop() instead of OFF_TO_IDX() for convertion of addresses or
addresses offsets, as intended.
MFC r315580 (by alc):
Simplify the logic for clipping the range returned by the pager to fit
within the map entry.
Use atop() rather than OFF_TO_IDX() on addresses.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/drm/drm_scatter.c | 2 | ||||
-rw-r--r-- | sys/dev/drm2/drm_scatter.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/drm/drm_scatter.c b/sys/dev/drm/drm_scatter.c index 1a78616..c202475 100644 --- a/sys/dev/drm/drm_scatter.c +++ b/sys/dev/drm/drm_scatter.c @@ -48,7 +48,7 @@ drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather *request) entry = malloc(sizeof(*entry), DRM_MEM_DRIVER, M_WAITOK | M_ZERO); size = round_page(request->size); - entry->pages = OFF_TO_IDX(size); + entry->pages = atop(size); entry->busaddr = malloc(entry->pages * sizeof(*entry->busaddr), DRM_MEM_SGLISTS, M_WAITOK | M_ZERO); diff --git a/sys/dev/drm2/drm_scatter.c b/sys/dev/drm2/drm_scatter.c index 9be3cb1..6e69f0c 100644 --- a/sys/dev/drm2/drm_scatter.c +++ b/sys/dev/drm2/drm_scatter.c @@ -74,7 +74,7 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request) DRM_DEBUG("request size=%ld\n", request->size); size = round_page(request->size); - entry->pages = OFF_TO_IDX(size); + entry->pages = atop(size); entry->busaddr = malloc(entry->pages * sizeof(*entry->busaddr), DRM_MEM_SGLISTS, M_NOWAIT | M_ZERO); if (!entry->busaddr) { |