Displaying 20 results from an estimated 84 matches for "__big_endian".
2017 Apr 05
4
[PATCH] drm: virtio: fix virtio_gpu_cursor_formats
...e.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
index 11288ff..3ed7174 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -39,7 +39,11 @@ static const uint32_t virtio_gpu_formats[] = {
};
static const uint32_t virtio_gpu_cursor_formats[] = {
+#ifdef __BIG_ENDIAN
+ DRM_FORMAT_BGRA8888,
+#else
DRM_FORMAT_ARGB8888,
+#endif
};
static void virtio_gpu_plane_destroy(struct drm_plane *plane)
--
2.9.3
2017 Apr 05
4
[PATCH] drm: virtio: fix virtio_gpu_cursor_formats
...e.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
index 11288ff..3ed7174 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -39,7 +39,11 @@ static const uint32_t virtio_gpu_formats[] = {
};
static const uint32_t virtio_gpu_cursor_formats[] = {
+#ifdef __BIG_ENDIAN
+ DRM_FORMAT_BGRA8888,
+#else
DRM_FORMAT_ARGB8888,
+#endif
};
static void virtio_gpu_plane_destroy(struct drm_plane *plane)
--
2.9.3
2009 Jul 25
2
[RFC] patch 0/4: DRM MMIO accessor cleanup
Hi,
this is continuation for the MMIO accessor rewrite and cleanup.
I am currently running nv28 with these patches applied, but
I cannot test on PPC.
Please, review and comment. If the direction is good, I'll do the
same to INSTANCE_{RD,WR} as I did for nv_{rd,wr}32, and change
PRAMIN from drm_local_map to simple ioremap.
Can the same be done for channel specific mappings, that is
2020 Apr 28
3
[PATCH v3 1/3] device: rework mmio mapping code to get rid of second map
...emap(mmio_base, mmio_size);
+ if (map == NULL) {
+ nvdev_error(device, "unable to map PRI\n");
+ ret = -ENOMEM;
goto done;
+ }
+ }
+ /* identify the chipset, and determine classes of subdev/engines */
+ if (detect) {
/* switch mmio to cpu's native endianness */
#ifndef __BIG_ENDIAN
if (ioread32_native(map + 0x000004) != 0x00000000) {
@@ -2980,7 +2985,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
/* read boot0 and strapping information */
boot0 = ioread32_native(map + 0x000000);
strap = ioread32_native(map + 0x101000);
- iounmap(map);
/* chipset...
2017 Apr 03
2
[PATCH 1/2] drm: virtio: add virtio_gpu_translate_format
...u/drm/virtio/virtgpu_fb.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fb.c
@@ -231,63 +231,9 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
mode_cmd.pitches[0] = mode_cmd.width * 4;
mode_cmd.pixel_format = drm_mode_legacy_fb_format(32, 24);
- switch (mode_cmd.pixel_format) {
-#ifdef __BIG_ENDIAN
- case DRM_FORMAT_XRGB8888:
- format = VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM;
- break;
- case DRM_FORMAT_ARGB8888:
- format = VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM;
- break;
- case DRM_FORMAT_BGRX8888:
- format = VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM;
- break;
- case DRM_FORMAT_BGRA8888:
- format = VIRTIO_...
2017 Apr 03
2
[PATCH 1/2] drm: virtio: add virtio_gpu_translate_format
...u/drm/virtio/virtgpu_fb.c
+++ b/drivers/gpu/drm/virtio/virtgpu_fb.c
@@ -231,63 +231,9 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
mode_cmd.pitches[0] = mode_cmd.width * 4;
mode_cmd.pixel_format = drm_mode_legacy_fb_format(32, 24);
- switch (mode_cmd.pixel_format) {
-#ifdef __BIG_ENDIAN
- case DRM_FORMAT_XRGB8888:
- format = VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM;
- break;
- case DRM_FORMAT_ARGB8888:
- format = VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM;
- break;
- case DRM_FORMAT_BGRX8888:
- format = VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM;
- break;
- case DRM_FORMAT_BGRA8888:
- format = VIRTIO_...
2020 Oct 13
3
[PATCH] drm/nouveau/device: fix changing endianess code to work on older GPUs
.../device/base.c
@@ -2924,17 +2924,34 @@ nvkm_device_del(struct nvkm_device **pdevice)
}
}
+/* returns true if the GPU is in the CPU native byte order */
static inline bool
nvkm_device_endianness(struct nvkm_device *device)
{
- u32 boot1 = nvkm_rd32(device, 0x000004) & 0x01000001;
#ifdef __BIG_ENDIAN
- if (!boot1)
- return false;
+ const bool big_endian = true;
#else
- if (boot1)
- return false;
+ const bool big_endian = false;
#endif
+
+ /* Read NV_PMC_BOOT_1, and assume non-functional endian switch if it
+ * doesn't contain the expected values.
+ */
+ u32 pmc_boot_1 = nvkm_rd32(devi...
2017 Apr 06
3
DRM_FORMAT_* byte order (was: Re: [PATCH] drm: virtio: fix virtio_gpu_cursor_formats)
Hi,
> > static const uint32_t virtio_gpu_cursor_formats[] = {
> > +#ifdef __BIG_ENDIAN
> > + DRM_FORMAT_BGRA8888,
> > +#else
> > DRM_FORMAT_ARGB8888,
> > +#endif
>
> DRM formats are supposed to be little endian, so this isn't really
> correct.
Well, maybe they where *intended* to be little endian at some point in
the past. The actual code app...
2017 Apr 06
3
DRM_FORMAT_* byte order (was: Re: [PATCH] drm: virtio: fix virtio_gpu_cursor_formats)
Hi,
> > static const uint32_t virtio_gpu_cursor_formats[] = {
> > +#ifdef __BIG_ENDIAN
> > + DRM_FORMAT_BGRA8888,
> > +#else
> > DRM_FORMAT_ARGB8888,
> > +#endif
>
> DRM formats are supposed to be little endian, so this isn't really
> correct.
Well, maybe they where *intended* to be little endian at some point in
the past. The actual code app...
2020 Apr 28
0
[PATCH v3 2/3] device: detect if changing endianness failed
...a/drm/nouveau/nvkm/engine/device/base.c
+++ b/drm/nouveau/nvkm/engine/device/base.c
@@ -2924,6 +2924,20 @@ nvkm_device_del(struct nvkm_device **pdevice)
}
}
+static inline bool
+nvkm_device_endianness(void __iomem *pri)
+{
+ u32 boot1 = ioread32_native(pri + 0x000004) & 0x01000001;
+#ifdef __BIG_ENDIAN
+ if (!boot1)
+ return false;
+#else
+ if (boot1)
+ return false;
+#endif
+ return true;
+}
+
int
nvkm_device_ctor(const struct nvkm_device_func *func,
const struct nvkm_device_quirk *quirk,
@@ -2973,13 +2987,15 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
/* identify the chip...
2017 Apr 24
0
[PATCH 5/6] drm: fourcc byteorder: adapt virtio to drm_mode_legacy_fb_format update
...drivers/gpu/drm/virtio/virtgpu_plane.c
index adcdbd0abe..f40ffc9a70 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -39,11 +39,7 @@ static const uint32_t virtio_gpu_formats[] = {
};
static const uint32_t virtio_gpu_cursor_formats[] = {
-#ifdef __BIG_ENDIAN
- DRM_FORMAT_BGRA8888,
-#else
DRM_FORMAT_ARGB8888,
-#endif
};
uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc)
@@ -51,32 +47,6 @@ uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc)
uint32_t format;
switch (drm_fourcc) {
-#ifdef __BIG_ENDIAN
- case DRM_FORMAT_XRGB8888:
-...
2017 Apr 24
0
[PATCH 5/6] drm: fourcc byteorder: adapt virtio to drm_mode_legacy_fb_format update
...drivers/gpu/drm/virtio/virtgpu_plane.c
index adcdbd0abe..f40ffc9a70 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -39,11 +39,7 @@ static const uint32_t virtio_gpu_formats[] = {
};
static const uint32_t virtio_gpu_cursor_formats[] = {
-#ifdef __BIG_ENDIAN
- DRM_FORMAT_BGRA8888,
-#else
DRM_FORMAT_ARGB8888,
-#endif
};
uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc)
@@ -51,32 +47,6 @@ uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc)
uint32_t format;
switch (drm_fourcc) {
-#ifdef __BIG_ENDIAN
- case DRM_FORMAT_XRGB8888:
-...
2023 Jan 14
1
[klibc:time64] time: Use 64-bit time types on all architectures
...for Ben Hutchings wrote:
>
> #include <klibc/extern.h>
> +#include <klibc/endian.h>
> #include <stddef.h>
> #include <sys/types.h>
> -#include <linux/time.h>
> +
> +struct timespec {
> + __kernel_time64_t tv_sec;
> +#if __BYTE_ORDER == __BIG_ENDIAN && __BITS_PER_LONG == 32
> + long __tv_pad;
> +#endif
> + long tv_nsec;
> +#if __BYTE_ORDER == __LITTLE_ENDIAN && __BITS_PER_LONG == 32
> + long __tv_pad;
> +#endif
> +};
The problem with this definition is applications doing things like
struct timespec...
2014 Apr 17
1
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
> +#if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN)
> +#error "Missing either LITTLE_ENDIAN or BIG_ENDIAN definition."
> +#endif
This seems entirely superfluous, I don't think a kernel build will go
anywhere if either is missing.
2014 Apr 17
1
[PATCH v9 05/19] qspinlock: Optimize for smaller NR_CPUS
On Thu, Apr 17, 2014 at 11:03:57AM -0400, Waiman Long wrote:
> +#if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN)
> +#error "Missing either LITTLE_ENDIAN or BIG_ENDIAN definition."
> +#endif
This seems entirely superfluous, I don't think a kernel build will go
anywhere if either is missing.
2020 Apr 17
2
[PATCH 1/3] device: use the correct mmio size when mapping
Fixes warnings on GPUs with smaller a smaller mmio region like vGPUs.
Signed-off-by: Karol Herbst <kherbst at redhat.com>
---
drm/nouveau/nvkm/engine/device/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c
index 8ebbe1656..17676c75a 100644
--- a/drm/nouveau/nvkm/engine/device/base.c
+++
2020 Apr 17
2
[PATCH v2 1/3] device: use the correct mmio size when mapping
Fixes warnings on GPUs with smaller a smaller mmio region like vGPUs.
Signed-off-by: Karol Herbst <kherbst at redhat.com>
---
drm/nouveau/nvkm/engine/device/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drm/nouveau/nvkm/engine/device/base.c b/drm/nouveau/nvkm/engine/device/base.c
index 8ebbe1656..17676c75a 100644
--- a/drm/nouveau/nvkm/engine/device/base.c
+++
2017 Apr 03
0
[PATCH 1/2] drm: virtio: add virtio_gpu_translate_format
...b/drivers/gpu/drm/virtio/virtgpu_fb.c
> @@ -231,63 +231,9 @@ static int virtio_gpufb_create(struct drm_fb_helper *helper,
> mode_cmd.pitches[0] = mode_cmd.width * 4;
> mode_cmd.pixel_format = drm_mode_legacy_fb_format(32, 24);
>
> - switch (mode_cmd.pixel_format) {
> -#ifdef __BIG_ENDIAN
> - case DRM_FORMAT_XRGB8888:
> - format = VIRTIO_GPU_FORMAT_X8R8G8B8_UNORM;
> - break;
> - case DRM_FORMAT_ARGB8888:
> - format = VIRTIO_GPU_FORMAT_A8R8G8B8_UNORM;
> - break;
> - case DRM_FORMAT_BGRX8888:
> - format = VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM;
> - break;
&g...
2018 Sep 05
0
[PATCH v2 6/6] drm/virtio: fix DRM_FORMAT_* handling
..._gpu_formats[] = {
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_ARGB8888,
- DRM_FORMAT_BGRX8888,
- DRM_FORMAT_BGRA8888,
- DRM_FORMAT_RGBX8888,
- DRM_FORMAT_RGBA8888,
- DRM_FORMAT_XBGR8888,
- DRM_FORMAT_ABGR8888,
+ DRM_FORMAT_HOST_XRGB8888,
};
static const uint32_t virtio_gpu_cursor_formats[] = {
-#ifdef __BIG_ENDIAN
- DRM_FORMAT_BGRA8888,
-#else
- DRM_FORMAT_ARGB8888,
-#endif
+ DRM_FORMAT_HOST_ARGB8888,
};
uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc)
@@ -51,32 +40,6 @@ uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc)
uint32_t format;
switch (drm_fourcc) {
-#ifdef __BIG_ENDIAN
-...
2018 Sep 19
0
[PATCH v3 5/5] drm/virtio: fix DRM_FORMAT_* handling
..._gpu_formats[] = {
- DRM_FORMAT_XRGB8888,
- DRM_FORMAT_ARGB8888,
- DRM_FORMAT_BGRX8888,
- DRM_FORMAT_BGRA8888,
- DRM_FORMAT_RGBX8888,
- DRM_FORMAT_RGBA8888,
- DRM_FORMAT_XBGR8888,
- DRM_FORMAT_ABGR8888,
+ DRM_FORMAT_HOST_XRGB8888,
};
static const uint32_t virtio_gpu_cursor_formats[] = {
-#ifdef __BIG_ENDIAN
- DRM_FORMAT_BGRA8888,
-#else
- DRM_FORMAT_ARGB8888,
-#endif
+ DRM_FORMAT_HOST_ARGB8888,
};
uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc)
@@ -51,32 +40,6 @@ uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc)
uint32_t format;
switch (drm_fourcc) {
-#ifdef __BIG_ENDIAN
-...