drm: Permit video-buffers writecombine mapping for MIPS
Subsystems (4)
PATCH 1/1 drm: Permit video-buffers writecombine mapping for MIPS
Since commit 4b050ba7a66c ("MIPS: pgtable.h: Implement the pgprot_writecombine function for MIPS") and commit c4687b15a848 ("MIPS: Fix definition of pgprot_writecombine()") write-combine vma mapping is available to be used by kernel subsystems for MIPS. In particular the uncached accelerated attribute is requested to be set by ioremap_wc() method and by generic PCI memory pages/ranges mapping methods. The same is done by the drm_io_prot()/ttm_io_prot() functions in case if write-combine flag is set for vma's passed for mapping. But for some reason the pgprot_writecombine() method calling is ifdefed to be a platform-specific with MIPS system being marked as lacking of one. At the very least it doesn't reflect the current MIPS platform implementation. So in order to improve the DRM subsystem performance on MIPS with UCA mapping enabled, we need to have pgprot_writecombine() called for buffers, which need store operations being combined. In case if particular MIPS chip doesn't support the UCA attribute, the mapping will fall back to noncached.
--- drivers/gpu/drm/drm_vm.c | 5 +++-- drivers/gpu/drm/ttm/ttm_bo_util.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_vm.c +3 -2
@@ -62,7 +62,8 @@ static pgprot_t drm_io_prot(struct drm_local_map *map,/* We don't want graphics memory to be mapped encrypted */ tmp =pgprot_decrypted (tmp); -#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) +#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || \ + defined(__mips__)if (map->type == _DRM_REGISTERS && !(map->flags & _DRM_WRITE_COMBINING)) tmp =pgprot_noncached (tmp);else
@@ -73,7 +74,7 @@ static pgprot_t drm_io_prot(struct drm_local_map *map, tmp =pgprot_writecombine (tmp); else tmp =pgprot_noncached (tmp); -#elif defined(__sparc__) || defined(__arm__) || defined(__mips__) +#elif defined(__sparc__) || defined(__arm__) tmp =pgprot_noncached (tmp);#endif return tmp;
drivers/gpu/drm/ttm/ttm_bo_util.c +2 -2
@@ -539,13 +539,13 @@ pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp) tmp =pgprot_noncached (tmp);#endif #if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \ - defined(__powerpc__) + defined(__powerpc__) || defined(__mips__)if (caching_flags &TTM_PL_FLAG_WC ) tmp =pgprot_writecombine (tmp);else tmp =pgprot_noncached (tmp);#endif -#if defined(__sparc__) || defined(__mips__) +#if defined(__sparc__) tmp =pgprot_noncached (tmp);#endif return tmp;
Signature · 1 line
2.21.0
Am 23.04.19 um 14:31 schrieb Serge Semin:
Quoted 17 lines
Since commit
4b050ba7a66c("MIPS:pgtable.h: Implement thepgprot_writecombinefunction for MIPS") and commitc4687b15a848("MIPS: Fix definition ofpgprot_writecombine()") write-combine vma mapping is available to be used by kernel subsystems for MIPS. In particular the uncached accelerated attribute is requested to be set byioremap_wc()method and by generic PCI memory pages/ranges mapping methods. The same is done by the drm_io_prot()/ttm_io_prot() functions in case if write-combine flag is set for vma's passed for mapping. But for some reason thepgprot_writecombine()method calling is ifdefed to be a platform-specific with MIPS system being marked as lacking of one. At the very least it doesn't reflect the current MIPS platform implementation. So in order to improve the DRM subsystem performance on MIPS with UCA mapping enabled, we need to havepgprot_writecombine()called for buffers, which need store operations being combined. In case if particular MIPS chip doesn't support the UCA attribute, the mapping will fall back to noncached.
Quoted 5 lines
Cc Ralf Baechle <[email protected]>Cc Paul Burton <[email protected]>Cc James Hogan <[email protected]>Signed-off-by Vadim V. Vlasov <[email protected]>Signed-off-by Serge Semin <[email protected]>
Not sure about all the details, but at least from the two mile high view that seems to make sense.
Quoted 48 lines
--- drivers/gpu/drm/drm_vm.c | 5 +++-- drivers/gpu/drm/ttm/ttm_bo_util.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/drm_vm.c +3
-2@@ -62,7 +62,8 @@ static pgprot_t drm_io_prot(struct drm_local_map *map,/* We don't want graphics memory to be mapped encrypted */ tmp =pgprot_decrypted (tmp); -#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) +#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || \ + defined(__mips__)if (map->type == _DRM_REGISTERS && !(map->flags & _DRM_WRITE_COMBINING)) tmp =pgprot_noncached (tmp);else @@ -73,7 +74,7 @@ static pgprot_t drm_io_prot(struct drm_local_map *map, tmp =pgprot_writecombine (tmp); else tmp =pgprot_noncached (tmp); -#elif defined(__sparc__) || defined(__arm__) || defined(__mips__) +#elif defined(__sparc__) || defined(__arm__) tmp =pgprot_noncached (tmp);#endif return tmp;drivers/gpu/drm/ttm/ttm_bo_util.c +2
-2@@ -539,13 +539,13 @@ pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp) tmp =pgprot_noncached (tmp);#endif #if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \ - defined(__powerpc__) + defined(__powerpc__) || defined(__mips__)if (caching_flags &TTM_PL_FLAG_WC ) tmp =pgprot_writecombine (tmp);else tmp =pgprot_noncached (tmp);#endif -#if defined(__sparc__) || defined(__mips__) +#if defined(__sparc__) tmp =pgprot_noncached (tmp);#endif return tmp;
Hi Serge,
Quoted 22 lines · Serge Semin
Since commit
4b050ba7a66c("MIPS:pgtable.h: Implement thepgprot_writecombinefunction for MIPS") and commitc4687b15a848("MIPS: Fix definition ofpgprot_writecombine()") write-combine vma mapping is available to be used by kernel subsystems for MIPS. In particular the uncached accelerated attribute is requested to be set byioremap_wc()method and by generic PCI memory pages/ranges mapping methods. The same is done by the drm_io_prot()/ttm_io_prot() functions in case if write-combine flag is set for vma's passed for mapping. But for some reason thepgprot_writecombine()method calling is ifdefed to be a platform-specific with MIPS system being marked as lacking of one. At the very least it doesn't reflect the current MIPS platform implementation. So in order to improve the DRM subsystem performance on MIPS with UCA mapping enabled, we need to havepgprot_writecombine()called for buffers, which need store operations being combined. In case if particular MIPS chip doesn't support the UCA attribute, the mapping will fall back to noncached.Cc Ralf Baechle <[email protected]>Cc Paul Burton <[email protected]>Cc James Hogan <[email protected]>Signed-off-by Vadim V. Vlasov <[email protected]>Signed-off-by Serge Semin <[email protected]>
Quoted 4 lines
--- drivers/gpu/drm/drm_vm.c | 5 +++-- drivers/gpu/drm/ttm/ttm_bo_util.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)
Looks good to me:
Thanks,
Paul
Hello folks,
Any updates of this patch status? It has been here for about two months.
Regards,
-Sergey
Quoted 73 lines · Serge Semin
Since commit
4b050ba7a66c("MIPS:pgtable.h: Implement thepgprot_writecombinefunction for MIPS") and commitc4687b15a848("MIPS: Fix definition ofpgprot_writecombine()") write-combine vma mapping is available to be used by kernel subsystems for MIPS. In particular the uncached accelerated attribute is requested to be set byioremap_wc()method and by generic PCI memory pages/ranges mapping methods. The same is done by the drm_io_prot()/ttm_io_prot() functions in case if write-combine flag is set for vma's passed for mapping. But for some reason thepgprot_writecombine()method calling is ifdefed to be a platform-specific with MIPS system being marked as lacking of one. At the very least it doesn't reflect the current MIPS platform implementation. So in order to improve the DRM subsystem performance on MIPS with UCA mapping enabled, we need to havepgprot_writecombine()called for buffers, which need store operations being combined. In case if particular MIPS chip doesn't support the UCA attribute, the mapping will fall back to noncached.Cc Ralf Baechle <[email protected]>Cc Paul Burton <[email protected]>Cc James Hogan <[email protected]>Signed-off-by Vadim V. Vlasov <[email protected]>Signed-off-by Serge Semin <[email protected]>--- drivers/gpu/drm/drm_vm.c | 5 +++-- drivers/gpu/drm/ttm/ttm_bo_util.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/drm_vm.c +3
-2@@ -62,7 +62,8 @@ static pgprot_t drm_io_prot(struct drm_local_map *map,/* We don't want graphics memory to be mapped encrypted */ tmp =pgprot_decrypted (tmp); -#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) +#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || \ + defined(__mips__)if (map->type == _DRM_REGISTERS && !(map->flags & _DRM_WRITE_COMBINING)) tmp =pgprot_noncached (tmp);else @@ -73,7 +74,7 @@ static pgprot_t drm_io_prot(struct drm_local_map *map, tmp =pgprot_writecombine (tmp); else tmp =pgprot_noncached (tmp); -#elif defined(__sparc__) || defined(__arm__) || defined(__mips__) +#elif defined(__sparc__) || defined(__arm__) tmp =pgprot_noncached (tmp);#endif return tmp;drivers/gpu/drm/ttm/ttm_bo_util.c +2
-2@@ -539,13 +539,13 @@ pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp) tmp =pgprot_noncached (tmp);#endif #if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \ - defined(__powerpc__) + defined(__powerpc__) || defined(__mips__)if (caching_flags &TTM_PL_FLAG_WC ) tmp =pgprot_writecombine (tmp);else tmp =pgprot_noncached (tmp);#endif -#if defined(__sparc__) || defined(__mips__) +#if defined(__sparc__) tmp =pgprot_noncached (tmp);#endif return tmp;Signature · 1 line
2.21.0
Quoted 4 lines · Serge Semin
Hello folks,
Any updates of this patch status? It has been here for about two months.
Sorry for the mixup, looks like this one just fell through the cracks. I've applied it to drm-misc-next with the attached Ack and Review.
Sean
Quoted 77 lines
Regards,
-SergeyQuoted 73 lines · Serge Semin
Since commit
4b050ba7a66c("MIPS:pgtable.h: Implement thepgprot_writecombinefunction for MIPS") and commitc4687b15a848("MIPS: Fix definition ofpgprot_writecombine()") write-combine vma mapping is available to be used by kernel subsystems for MIPS. In particular the uncached accelerated attribute is requested to be set byioremap_wc()method and by generic PCI memory pages/ranges mapping methods. The same is done by the drm_io_prot()/ttm_io_prot() functions in case if write-combine flag is set for vma's passed for mapping. But for some reason thepgprot_writecombine()method calling is ifdefed to be a platform-specific with MIPS system being marked as lacking of one. At the very least it doesn't reflect the current MIPS platform implementation. So in order to improve the DRM subsystem performance on MIPS with UCA mapping enabled, we need to havepgprot_writecombine()called for buffers, which need store operations being combined. In case if particular MIPS chip doesn't support the UCA attribute, the mapping will fall back to noncached.Cc Ralf Baechle <[email protected]>Cc Paul Burton <[email protected]>Cc James Hogan <[email protected]>Signed-off-by Vadim V. Vlasov <[email protected]>Signed-off-by Serge Semin <[email protected]>--- drivers/gpu/drm/drm_vm.c | 5 +++-- drivers/gpu/drm/ttm/ttm_bo_util.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/drm_vm.c +3
-2@@ -62,7 +62,8 @@ static pgprot_t drm_io_prot(struct drm_local_map *map,/* We don't want graphics memory to be mapped encrypted */ tmp =pgprot_decrypted (tmp); -#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) +#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || \ + defined(__mips__)if (map->type == _DRM_REGISTERS && !(map->flags & _DRM_WRITE_COMBINING)) tmp =pgprot_noncached (tmp);else @@ -73,7 +74,7 @@ static pgprot_t drm_io_prot(struct drm_local_map *map, tmp =pgprot_writecombine (tmp); else tmp =pgprot_noncached (tmp); -#elif defined(__sparc__) || defined(__arm__) || defined(__mips__) +#elif defined(__sparc__) || defined(__arm__) tmp =pgprot_noncached (tmp);#endif return tmp;drivers/gpu/drm/ttm/ttm_bo_util.c +2
-2@@ -539,13 +539,13 @@ pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp) tmp =pgprot_noncached (tmp);#endif #if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \ - defined(__powerpc__) + defined(__powerpc__) || defined(__mips__)if (caching_flags &TTM_PL_FLAG_WC ) tmp =pgprot_writecombine (tmp);else tmp =pgprot_noncached (tmp);#endif -#if defined(__sparc__) || defined(__mips__) +#if defined(__sparc__) tmp =pgprot_noncached (tmp);#endif return tmp;Signature · 1 line
2.21.0
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hello Sean,
Quoted 9 lines · Sean Paul
Quoted 4 lines · Serge Semin
Hello folks,
Any updates of this patch status? It has been here for about two months.
Sorry for the mixup, looks like this one just fell through the cracks. I've applied it to drm-misc-next with the attached Ack and Review.
Great! Thank you.
Regards,
-Sergey
Quoted 83 lines
Sean
Quoted 77 lines
Regards,
-SergeyQuoted 73 lines · Serge Semin
Since commit
4b050ba7a66c("MIPS:pgtable.h: Implement thepgprot_writecombinefunction for MIPS") and commitc4687b15a848("MIPS: Fix definition ofpgprot_writecombine()") write-combine vma mapping is available to be used by kernel subsystems for MIPS. In particular the uncached accelerated attribute is requested to be set byioremap_wc()method and by generic PCI memory pages/ranges mapping methods. The same is done by the drm_io_prot()/ttm_io_prot() functions in case if write-combine flag is set for vma's passed for mapping. But for some reason thepgprot_writecombine()method calling is ifdefed to be a platform-specific with MIPS system being marked as lacking of one. At the very least it doesn't reflect the current MIPS platform implementation. So in order to improve the DRM subsystem performance on MIPS with UCA mapping enabled, we need to havepgprot_writecombine()called for buffers, which need store operations being combined. In case if particular MIPS chip doesn't support the UCA attribute, the mapping will fall back to noncached.Cc Ralf Baechle <[email protected]>Cc Paul Burton <[email protected]>Cc James Hogan <[email protected]>Signed-off-by Vadim V. Vlasov <[email protected]>Signed-off-by Serge Semin <[email protected]>--- drivers/gpu/drm/drm_vm.c | 5 +++-- drivers/gpu/drm/ttm/ttm_bo_util.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/drm_vm.c +3
-2@@ -62,7 +62,8 @@ static pgprot_t drm_io_prot(struct drm_local_map *map,/* We don't want graphics memory to be mapped encrypted */ tmp =pgprot_decrypted (tmp); -#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) +#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__) || \ + defined(__mips__)if (map->type == _DRM_REGISTERS && !(map->flags & _DRM_WRITE_COMBINING)) tmp =pgprot_noncached (tmp);else @@ -73,7 +74,7 @@ static pgprot_t drm_io_prot(struct drm_local_map *map, tmp =pgprot_writecombine (tmp); else tmp =pgprot_noncached (tmp); -#elif defined(__sparc__) || defined(__arm__) || defined(__mips__) +#elif defined(__sparc__) || defined(__arm__) tmp =pgprot_noncached (tmp);#endif return tmp;drivers/gpu/drm/ttm/ttm_bo_util.c +2
-2@@ -539,13 +539,13 @@ pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp) tmp =pgprot_noncached (tmp);#endif #if defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || \ - defined(__powerpc__) + defined(__powerpc__) || defined(__mips__)if (caching_flags &TTM_PL_FLAG_WC ) tmp =pgprot_writecombine (tmp);else tmp =pgprot_noncached (tmp);#endif -#if defined(__sparc__) || defined(__mips__) +#if defined(__sparc__) tmp =pgprot_noncached (tmp);#endif return tmp;Signature · 1 line
2.21.0Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS