Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58cba7c2 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Dave Airlie
Browse files

udl-kms: avoid prefetch



Modern processors can detect linear memory accesses and prefetch data
automatically, so there's no need to use prefetch.

Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 91ba11fb
Loading
Loading
Loading
Loading
+0 −7
Original line number Original line Diff line number Diff line
@@ -13,7 +13,6 @@
#include <linux/module.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/fb.h>
#include <linux/fb.h>
#include <linux/prefetch.h>
#include <asm/unaligned.h>
#include <asm/unaligned.h>


#include <drm/drmP.h>
#include <drm/drmP.h>
@@ -51,9 +50,6 @@ static int udl_trim_hline(const u8 *bback, const u8 **bfront, int *width_bytes)
	int start = width;
	int start = width;
	int end = width;
	int end = width;


	prefetch((void *) front);
	prefetch((void *) back);

	for (j = 0; j < width; j++) {
	for (j = 0; j < width; j++) {
		if (back[j] != front[j]) {
		if (back[j] != front[j]) {
			start = j;
			start = j;
@@ -140,8 +136,6 @@ static void udl_compress_hline16(
		const u8 *cmd_pixel_start, *cmd_pixel_end = NULL;
		const u8 *cmd_pixel_start, *cmd_pixel_end = NULL;
		uint16_t pixel_val16;
		uint16_t pixel_val16;


		prefetchw((void *) cmd); /* pull in one cache line at least */

		*cmd++ = 0xaf;
		*cmd++ = 0xaf;
		*cmd++ = 0x6b;
		*cmd++ = 0x6b;
		*cmd++ = (uint8_t) ((dev_addr >> 16) & 0xFF);
		*cmd++ = (uint8_t) ((dev_addr >> 16) & 0xFF);
@@ -158,7 +152,6 @@ static void udl_compress_hline16(
					(unsigned long)(pixel_end - pixel) >> log_bpp,
					(unsigned long)(pixel_end - pixel) >> log_bpp,
					(unsigned long)(cmd_buffer_end - 1 - cmd) / 2) << log_bpp);
					(unsigned long)(cmd_buffer_end - 1 - cmd) / 2) << log_bpp);


		prefetch_range((void *) pixel, cmd_pixel_end - pixel);
		pixel_val16 = get_pixel_val16(pixel, log_bpp);
		pixel_val16 = get_pixel_val16(pixel, log_bpp);


		while (pixel < cmd_pixel_end) {
		while (pixel < cmd_pixel_end) {