summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-11-22 17:54:45 +0100
committerMichel Dänzer <michel@daenzer.net>2018-12-13 12:38:40 +0100
commite95044e45350870fa7e237860e89ade91ac03550 (patch)
tree3b76e45082f86c725cc5e22474b7fd0453ff303e /src
parent13c85e8a136e8626ba84656c6f8321394750f5c7 (diff)
Drop AMDGPUInfoRec::cursor_buffer array
Not needed or even useful for anything. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/amdgpu_drv.h1
-rw-r--r--src/amdgpu_kms.c20
-rw-r--r--src/drmmode_display.c10
-rw-r--r--src/drmmode_display.h2
4 files changed, 9 insertions, 24 deletions
diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index a212b40..7b3bace 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -296,7 +296,6 @@ typedef struct {
Bool shadow_fb;
void *fb_shadow;
struct amdgpu_buffer *front_buffer;
- struct amdgpu_buffer *cursor_buffer[32];
uint64_t vram_size;
uint64_t gart_size;
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 4ce9b9f..fad2382 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -2280,23 +2280,21 @@ static Bool amdgpu_setup_kernel_mem(ScreenPtr pScreen)
cursor_size = info->cursor_w * info->cursor_h * 4;
cursor_size = AMDGPU_ALIGN(cursor_size, AMDGPU_GPU_PAGE_SIZE);
for (c = 0; c < xf86_config->num_crtc; c++) {
- /* cursor objects */
- if (!info->cursor_buffer[c]) {
- info->cursor_buffer[c] = amdgpu_bo_open(pAMDGPUEnt->pDev,
- cursor_size, 0,
- AMDGPU_GEM_DOMAIN_VRAM);
- if (!(info->cursor_buffer[c])) {
+ drmmode_crtc_private_ptr drmmode_crtc = xf86_config->crtc[c]->driver_private;
+
+ if (!drmmode_crtc->cursor_buffer) {
+ drmmode_crtc->cursor_buffer = amdgpu_bo_open(pAMDGPUEnt->pDev,
+ cursor_size, 0,
+ AMDGPU_GEM_DOMAIN_VRAM);
+ if (!(drmmode_crtc->cursor_buffer)) {
ErrorF("Failed to allocate cursor buffer memory\n");
return FALSE;
}
- if (amdgpu_bo_cpu_map(info->cursor_buffer[c]->bo.amdgpu,
- &info->cursor_buffer[c]->cpu_ptr)) {
+ if (amdgpu_bo_cpu_map(drmmode_crtc->cursor_buffer->bo.amdgpu,
+ &drmmode_crtc->cursor_buffer->cpu_ptr)) {
ErrorF("Failed to map cursor buffer memory\n");
}
-
- drmmode_set_cursor(pScrn, &info->drmmode, c,
- info->cursor_buffer[c]);
}
}
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 7435043..2e9e623 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -3577,16 +3577,6 @@ miPointerSpriteFuncRec drmmode_sprite_funcs = {
};
-void drmmode_set_cursor(ScrnInfoPtr scrn, drmmode_ptr drmmode, int id,
- struct amdgpu_buffer *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_buffer = 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 aab330c..adcf6ad 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -234,8 +234,6 @@ extern int drmmode_page_flip_target_relative(AMDGPUEntPtr pAMDGPUEnt,
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 void drmmode_set_cursor(ScrnInfoPtr scrn, drmmode_ptr drmmode, int id,
- struct amdgpu_buffer *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);