diff options
author | Cai Huoqing <caihuoqing@baidu.com> | 2021-08-02 06:35:52 +0300 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2021-08-10 00:30:35 +0300 |
commit | 5f50b7659da63a6b80b4b6406c663c8dcd6401ba (patch) | |
tree | 9d3697e89ca4c01b4b6650ffa3757962f45bf1e9 /drivers/gpu | |
parent | bc65754ca61498f2bb351f6b0ad56f853fc7a966 (diff) | |
download | linux-5f50b7659da63a6b80b4b6406c663c8dcd6401ba.tar.xz |
drm/vmwgfx: Replace "vmw_num_pages" with "PFN_UP"
we counld use PFN_UP instead of vmw_num_pages()
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Zack Rusin <zackr@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210802033552.990-1-caihuoqing@baidu.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/device_include/vm_basic_types.h | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 6 |
2 files changed, 9 insertions, 10 deletions
diff --git a/drivers/gpu/drm/vmwgfx/device_include/vm_basic_types.h b/drivers/gpu/drm/vmwgfx/device_include/vm_basic_types.h index 35bd2852189f..1f6e3bbc6605 100644 --- a/drivers/gpu/drm/vmwgfx/device_include/vm_basic_types.h +++ b/drivers/gpu/drm/vmwgfx/device_include/vm_basic_types.h @@ -97,19 +97,18 @@ typedef __attribute__((aligned(32))) struct MKSGuestStatInfoEntry { } MKSGuestStatInfoEntry; #define INVALID_PPN64 ((PPN64)0x000fffffffffffffULL) -#define vmw_num_pages(size) (PAGE_ALIGN(size) >> PAGE_SHIFT) #define MKS_GUEST_STAT_INSTANCE_DESC_LENGTH 1024 #define MKS_GUEST_STAT_INSTANCE_MAX_STATS 4096 -#define MKS_GUEST_STAT_INSTANCE_MAX_STAT_PPNS \ - (vmw_num_pages(MKS_GUEST_STAT_INSTANCE_MAX_STATS * \ +#define MKS_GUEST_STAT_INSTANCE_MAX_STAT_PPNS \ + (PFN_UP(MKS_GUEST_STAT_INSTANCE_MAX_STATS * \ sizeof(MKSGuestStatCounterTime))) -#define MKS_GUEST_STAT_INSTANCE_MAX_INFO_PPNS \ - (vmw_num_pages(MKS_GUEST_STAT_INSTANCE_MAX_STATS * \ +#define MKS_GUEST_STAT_INSTANCE_MAX_INFO_PPNS \ + (PFN_UP(MKS_GUEST_STAT_INSTANCE_MAX_STATS * \ sizeof(MKSGuestStatInfoEntry))) #define MKS_GUEST_STAT_AVERAGE_NAME_LENGTH 40 -#define MKS_GUEST_STAT_INSTANCE_MAX_STRS_PPNS \ - (vmw_num_pages(MKS_GUEST_STAT_INSTANCE_MAX_STATS * \ +#define MKS_GUEST_STAT_INSTANCE_MAX_STRS_PPNS \ + (PFN_UP(MKS_GUEST_STAT_INSTANCE_MAX_STATS * \ MKS_GUEST_STAT_AVERAGE_NAME_LENGTH)) /* diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c index ed9c7b3a1e08..e50fb82a3030 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c @@ -1016,9 +1016,9 @@ int vmw_mksstat_add_ioctl(struct drm_device *dev, void *data, struct page *page; MKSGuestStatInstanceDescriptor *pdesc; - const size_t num_pages_stat = vmw_num_pages(arg->stat_len); - const size_t num_pages_info = vmw_num_pages(arg->info_len); - const size_t num_pages_strs = vmw_num_pages(arg->strs_len); + const size_t num_pages_stat = PFN_UP(arg->stat_len); + const size_t num_pages_info = PFN_UP(arg->info_len); + const size_t num_pages_strs = PFN_UP(arg->strs_len); long desc_len; long nr_pinned_stat; long nr_pinned_info; |