[PATCH xf86-video-ati 10/13] Drop RADEONInfoRec::cursor_bo array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michel Dänzer <michel.daenzer@xxxxxxx>

Not needed or even useful for anything.

(Ported from amdgpu commit e95044e45350870fa7e237860e89ade91ac03550)

Signed-off-by: Michel Dänzer <michel.daenzer@xxxxxxx>
---
 src/drmmode_display.c |  9 ---------
 src/drmmode_display.h |  1 -
 src/radeon.h          |  1 -
 src/radeon_kms.c      | 21 +++++++++++----------
 4 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 34c88c8e6..ef235bd21 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2967,15 +2967,6 @@ miPointerSpriteFuncRec drmmode_sprite_funcs = {
 };
 
 	
-void drmmode_set_cursor(ScrnInfoPtr scrn, drmmode_ptr drmmode, int id, struct radeon_bo *bo)
-{
-	xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
-	xf86CrtcPtr crtc = xf86_config->crtc[id];
-	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
-
-	drmmode_crtc->cursor_bo = bo;
-}
-
 void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y)
 {
 	xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR(pScrn);
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index f56596644..d7ab9d7e9 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -213,7 +213,6 @@ extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp);
 extern void drmmode_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
 extern void drmmode_fini(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
 extern Bool drmmode_set_bufmgr(ScrnInfoPtr pScrn, drmmode_ptr drmmode, struct radeon_bo_manager *bufmgr);
-extern void drmmode_set_cursor(ScrnInfoPtr scrn, drmmode_ptr drmmode, int id, struct radeon_bo *bo);
 void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y);
 extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode,
 				      Bool set_hw);
diff --git a/src/radeon.h b/src/radeon.h
index cde922c63..74454c307 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -572,7 +572,6 @@ typedef struct {
     struct radeon_cs_manager *csm;
     struct radeon_cs *cs;
 
-    struct radeon_bo *cursor_bo[32];
     uint64_t vram_size;
     uint64_t gart_size;
     drmmode_rec drmmode;
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index dd9955da7..27a02109a 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -2760,21 +2760,20 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
 	cursor_size = info->cursor_w * info->cursor_h * 4;
 	cursor_size = RADEON_ALIGN(cursor_size, RADEON_GPU_PAGE_SIZE);
 	for (c = 0; c < xf86_config->num_crtc; c++) {
-	    /* cursor objects */
-            if (!info->cursor_bo[c]) {
-                info->cursor_bo[c] = radeon_bo_open(info->bufmgr, 0,
-                                                    cursor_size, 0,
-                                                    RADEON_GEM_DOMAIN_VRAM, 0);
-                if (!info->cursor_bo[c]) {
+	    drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[c]->driver_private;
+
+	    if (!drmmode_crtc->cursor_bo) {
+		drmmode_crtc->cursor_bo = radeon_bo_open(info->bufmgr, 0,
+							 cursor_size, 0,
+							 RADEON_GEM_DOMAIN_VRAM, 0);
+		if (!(drmmode_crtc->cursor_bo)) {
                     ErrorF("Failed to allocate cursor buffer memory\n");
                     return FALSE;
                 }
 
-                if (radeon_bo_map(info->cursor_bo[c], 1)) {
+		if (radeon_bo_map(drmmode_crtc->cursor_bo, 1)) {
                     ErrorF("Failed to map cursor buffer memory\n");
                 }
-
-                drmmode_set_cursor(pScrn, &info->drmmode, c, info->cursor_bo[c]);
             }
         }
     }
@@ -2840,7 +2839,9 @@ void radeon_kms_update_vram_limit(ScrnInfoPtr pScrn, uint32_t new_fb_size)
     int c;
 
     for (c = 0; c < xf86_config->num_crtc; c++) {
-	if (info->cursor_bo[c])
+	drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[c]->driver_private;
+
+	if (drmmode_crtc->cursor_bo)
 	    new_fb_size += (64 * 4 * 64);
     }
 
-- 
2.20.1

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux