drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Red Hat Inc.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
* distribute, sub license, and/or sell copies of the Software, and to
|
|
|
|
* permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
* the following conditions:
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
|
|
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
|
|
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
|
|
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice (including the
|
|
|
|
* next paragraph) shall be included in all copies or substantial portions
|
|
|
|
* of the Software.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Authors: Dave Airlie <airlied@redhat.com>
|
|
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/errno.h>
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <linux/mm.h>
|
|
|
|
#include <linux/tty.h>
|
|
|
|
#include <linux/sysrq.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
|
|
|
|
|
2012-10-03 00:01:07 +07:00
|
|
|
#include <drm/drmP.h>
|
|
|
|
#include <drm/drm_crtc.h>
|
|
|
|
#include <drm/drm_fb_helper.h>
|
2019-01-13 02:32:44 +07:00
|
|
|
#include <drm/drm_util.h>
|
2013-01-21 05:12:54 +07:00
|
|
|
#include <drm/drm_crtc_helper.h>
|
2019-01-13 02:32:44 +07:00
|
|
|
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
#include "ast_drv.h"
|
|
|
|
|
|
|
|
static void ast_dirty_update(struct ast_fbdev *afbdev,
|
|
|
|
int x, int y, int width, int height)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
struct drm_gem_object *obj;
|
|
|
|
struct ast_bo *bo;
|
|
|
|
int src_offset, dst_offset;
|
2016-12-15 04:32:20 +07:00
|
|
|
int bpp = afbdev->afb.base.format->cpp[0];
|
2013-06-27 18:38:26 +07:00
|
|
|
int ret = -EBUSY;
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
bool unmap = false;
|
2013-05-02 13:40:25 +07:00
|
|
|
bool store_for_later = false;
|
|
|
|
int x2, y2;
|
|
|
|
unsigned long flags;
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
|
|
|
|
obj = afbdev->afb.obj;
|
|
|
|
bo = gem_to_ast_bo(obj);
|
|
|
|
|
2013-05-02 13:40:25 +07:00
|
|
|
/*
|
|
|
|
* try and reserve the BO, if we fail with busy
|
|
|
|
* then the BO is being moved and we should
|
|
|
|
* store up the damage until later.
|
|
|
|
*/
|
2014-02-05 11:47:45 +07:00
|
|
|
if (drm_can_sleep())
|
2013-06-27 18:38:26 +07:00
|
|
|
ret = ast_bo_reserve(bo, true);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
if (ret) {
|
2013-05-02 13:40:25 +07:00
|
|
|
if (ret != -EBUSY)
|
|
|
|
return;
|
|
|
|
|
|
|
|
store_for_later = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
x2 = x + width - 1;
|
|
|
|
y2 = y + height - 1;
|
|
|
|
spin_lock_irqsave(&afbdev->dirty_lock, flags);
|
|
|
|
|
|
|
|
if (afbdev->y1 < y)
|
|
|
|
y = afbdev->y1;
|
|
|
|
if (afbdev->y2 > y2)
|
|
|
|
y2 = afbdev->y2;
|
|
|
|
if (afbdev->x1 < x)
|
|
|
|
x = afbdev->x1;
|
|
|
|
if (afbdev->x2 > x2)
|
|
|
|
x2 = afbdev->x2;
|
|
|
|
|
|
|
|
if (store_for_later) {
|
|
|
|
afbdev->x1 = x;
|
|
|
|
afbdev->x2 = x2;
|
|
|
|
afbdev->y1 = y;
|
|
|
|
afbdev->y2 = y2;
|
|
|
|
spin_unlock_irqrestore(&afbdev->dirty_lock, flags);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-05-02 13:40:25 +07:00
|
|
|
afbdev->x1 = afbdev->y1 = INT_MAX;
|
|
|
|
afbdev->x2 = afbdev->y2 = 0;
|
|
|
|
spin_unlock_irqrestore(&afbdev->dirty_lock, flags);
|
|
|
|
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
if (!bo->kmap.virtual) {
|
|
|
|
ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &bo->kmap);
|
|
|
|
if (ret) {
|
|
|
|
DRM_ERROR("failed to kmap fb updates\n");
|
|
|
|
ast_bo_unreserve(bo);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
unmap = true;
|
|
|
|
}
|
2013-05-02 13:40:25 +07:00
|
|
|
for (i = y; i <= y2; i++) {
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
/* assume equal stride for now */
|
|
|
|
src_offset = dst_offset = i * afbdev->afb.base.pitches[0] + (x * bpp);
|
2013-05-02 13:40:25 +07:00
|
|
|
memcpy_toio(bo->kmap.virtual + src_offset, afbdev->sysram + src_offset, (x2 - x + 1) * bpp);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
|
|
|
|
}
|
|
|
|
if (unmap)
|
|
|
|
ttm_bo_kunmap(&bo->kmap);
|
|
|
|
|
|
|
|
ast_bo_unreserve(bo);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ast_fillrect(struct fb_info *info,
|
|
|
|
const struct fb_fillrect *rect)
|
|
|
|
{
|
|
|
|
struct ast_fbdev *afbdev = info->par;
|
2015-07-22 16:28:05 +07:00
|
|
|
drm_fb_helper_sys_fillrect(info, rect);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
ast_dirty_update(afbdev, rect->dx, rect->dy, rect->width,
|
|
|
|
rect->height);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ast_copyarea(struct fb_info *info,
|
|
|
|
const struct fb_copyarea *area)
|
|
|
|
{
|
|
|
|
struct ast_fbdev *afbdev = info->par;
|
2015-07-22 16:28:05 +07:00
|
|
|
drm_fb_helper_sys_copyarea(info, area);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
ast_dirty_update(afbdev, area->dx, area->dy, area->width,
|
|
|
|
area->height);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ast_imageblit(struct fb_info *info,
|
|
|
|
const struct fb_image *image)
|
|
|
|
{
|
|
|
|
struct ast_fbdev *afbdev = info->par;
|
2015-07-22 16:28:05 +07:00
|
|
|
drm_fb_helper_sys_imageblit(info, image);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
ast_dirty_update(afbdev, image->dx, image->dy, image->width,
|
|
|
|
image->height);
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct fb_ops astfb_ops = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.fb_check_var = drm_fb_helper_check_var,
|
|
|
|
.fb_set_par = drm_fb_helper_set_par,
|
|
|
|
.fb_fillrect = ast_fillrect,
|
|
|
|
.fb_copyarea = ast_copyarea,
|
|
|
|
.fb_imageblit = ast_imageblit,
|
|
|
|
.fb_pan_display = drm_fb_helper_pan_display,
|
|
|
|
.fb_blank = drm_fb_helper_blank,
|
|
|
|
.fb_setcmap = drm_fb_helper_setcmap,
|
|
|
|
.fb_debug_enter = drm_fb_helper_debug_enter,
|
|
|
|
.fb_debug_leave = drm_fb_helper_debug_leave,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int astfb_create_object(struct ast_fbdev *afbdev,
|
2015-11-12 00:11:29 +07:00
|
|
|
const struct drm_mode_fb_cmd2 *mode_cmd,
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
struct drm_gem_object **gobj_p)
|
|
|
|
{
|
|
|
|
struct drm_device *dev = afbdev->helper.dev;
|
|
|
|
u32 size;
|
|
|
|
struct drm_gem_object *gobj;
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
size = mode_cmd->pitches[0] * mode_cmd->height;
|
|
|
|
ret = ast_gem_create(dev, size, true, &gobj);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
*gobj_p = gobj;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-01-22 05:42:49 +07:00
|
|
|
static int astfb_create(struct drm_fb_helper *helper,
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
struct drm_fb_helper_surface_size *sizes)
|
|
|
|
{
|
2014-09-14 23:40:21 +07:00
|
|
|
struct ast_fbdev *afbdev =
|
|
|
|
container_of(helper, struct ast_fbdev, helper);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
struct drm_device *dev = afbdev->helper.dev;
|
|
|
|
struct drm_mode_fb_cmd2 mode_cmd;
|
|
|
|
struct drm_framebuffer *fb;
|
|
|
|
struct fb_info *info;
|
|
|
|
int size, ret;
|
|
|
|
void *sysram;
|
|
|
|
struct drm_gem_object *gobj = NULL;
|
|
|
|
mode_cmd.width = sizes->surface_width;
|
|
|
|
mode_cmd.height = sizes->surface_height;
|
|
|
|
mode_cmd.pitches[0] = mode_cmd.width * ((sizes->surface_bpp + 7)/8);
|
|
|
|
|
|
|
|
mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
|
|
|
|
sizes->surface_depth);
|
|
|
|
|
|
|
|
size = mode_cmd.pitches[0] * mode_cmd.height;
|
|
|
|
|
|
|
|
ret = astfb_create_object(afbdev, &mode_cmd, &gobj);
|
|
|
|
if (ret) {
|
|
|
|
DRM_ERROR("failed to create fbcon backing object %d\n", ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
sysram = vmalloc(size);
|
|
|
|
if (!sysram)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2015-07-22 16:28:05 +07:00
|
|
|
info = drm_fb_helper_alloc_fbi(helper);
|
|
|
|
if (IS_ERR(info)) {
|
|
|
|
ret = PTR_ERR(info);
|
2017-02-07 23:16:03 +07:00
|
|
|
goto out;
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
}
|
|
|
|
info->par = afbdev;
|
|
|
|
|
|
|
|
ret = ast_framebuffer_init(dev, &afbdev->afb, &mode_cmd, gobj);
|
|
|
|
if (ret)
|
2017-02-07 23:16:03 +07:00
|
|
|
goto out;
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
|
|
|
|
afbdev->sysram = sysram;
|
|
|
|
afbdev->size = size;
|
|
|
|
|
|
|
|
fb = &afbdev->afb.base;
|
|
|
|
afbdev->helper.fb = fb;
|
|
|
|
|
|
|
|
strcpy(info->fix.id, "astdrmfb");
|
|
|
|
|
|
|
|
info->fbops = &astfb_ops;
|
|
|
|
|
|
|
|
info->apertures->ranges[0].base = pci_resource_start(dev->pdev, 0);
|
|
|
|
info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0);
|
|
|
|
|
2016-12-15 04:31:35 +07:00
|
|
|
drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
drm_fb_helper_fill_var(info, &afbdev->helper, sizes->fb_width, sizes->fb_height);
|
|
|
|
|
|
|
|
info->screen_base = sysram;
|
|
|
|
info->screen_size = size;
|
|
|
|
|
|
|
|
info->pixmap.flags = FB_PIXMAP_SYSTEM;
|
|
|
|
|
|
|
|
DRM_DEBUG_KMS("allocated %dx%d\n",
|
|
|
|
fb->width, fb->height);
|
|
|
|
|
|
|
|
return 0;
|
2015-07-22 16:28:05 +07:00
|
|
|
|
2017-02-07 23:16:03 +07:00
|
|
|
out:
|
2016-11-14 10:03:59 +07:00
|
|
|
vfree(sysram);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2014-06-27 22:19:23 +07:00
|
|
|
static const struct drm_fb_helper_funcs ast_fb_helper_funcs = {
|
2013-01-22 05:42:49 +07:00
|
|
|
.fb_probe = astfb_create,
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
static void ast_fbdev_destroy(struct drm_device *dev,
|
|
|
|
struct ast_fbdev *afbdev)
|
|
|
|
{
|
|
|
|
struct ast_framebuffer *afb = &afbdev->afb;
|
2015-07-22 16:28:05 +07:00
|
|
|
|
2018-12-18 02:43:00 +07:00
|
|
|
drm_helper_force_disable_all(dev);
|
2015-07-22 16:28:05 +07:00
|
|
|
drm_fb_helper_unregister_fbi(&afbdev->helper);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
|
|
|
|
if (afb->obj) {
|
2017-08-11 19:32:50 +07:00
|
|
|
drm_gem_object_put_unlocked(afb->obj);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
afb->obj = NULL;
|
|
|
|
}
|
|
|
|
drm_fb_helper_fini(&afbdev->helper);
|
|
|
|
|
|
|
|
vfree(afbdev->sysram);
|
drm: revamp framebuffer cleanup interfaces
We have two classes of framebuffer
- Created by the driver (atm only for fbdev), and the driver holds
onto the last reference count until destruction.
- Created by userspace and associated with a given fd. These
framebuffers will be reaped when their assoiciated fb is closed.
Now these two cases are set up differently, the framebuffers are on
different lists and hence destruction needs to clean up different
things. Also, for userspace framebuffers we remove them from any
current usage, whereas for internal framebuffers it is assumed that
the driver has done this already.
Long story short, we need two different ways to cleanup such drivers.
Three functions are involved in total:
- drm_framebuffer_remove: Convenience function which removes the fb
from all active usage and then drops the passed-in reference.
- drm_framebuffer_unregister_private: Will remove driver-private
framebuffers from relevant lists and drop the corresponding
references. Should be called for driver-private framebuffers before
dropping the last reference (or like for a lot of the drivers where
the fbdev is embedded someplace else, before doing the cleanup
manually).
- drm_framebuffer_cleanup: Final cleanup for both classes of fbs,
should be called by the driver's ->destroy callback once the last
reference is gone.
This patch just rolls out the new interfaces and updates all drivers
(by adding calls to drm_framebuffer_unregister_private at all the
right places)- no functional changes yet. Follow-on patches will move
drm core code around and update the lifetime management for
framebuffers, so that we are no longer required to keep framebuffers
alive by locking mode_config.mutex.
I've also updated the kerneldoc already.
vmwgfx seems to again be a bit special, at least I haven't figured out
how the fbdev support in that driver works. It smells like it's
external though.
v2: The i915 driver creates another private framebuffer in the
load-detect code. Adjust its cleanup code, too.
Reviewed-by: Rob Clark <rob@ti.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-12-11 02:42:17 +07:00
|
|
|
drm_framebuffer_unregister_private(&afb->base);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
drm_framebuffer_cleanup(&afb->base);
|
|
|
|
}
|
|
|
|
|
|
|
|
int ast_fbdev_init(struct drm_device *dev)
|
|
|
|
{
|
|
|
|
struct ast_private *ast = dev->dev_private;
|
|
|
|
struct ast_fbdev *afbdev;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
afbdev = kzalloc(sizeof(struct ast_fbdev), GFP_KERNEL);
|
|
|
|
if (!afbdev)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
ast->fbdev = afbdev;
|
2013-05-02 13:40:25 +07:00
|
|
|
spin_lock_init(&afbdev->dirty_lock);
|
2014-06-27 22:19:24 +07:00
|
|
|
|
|
|
|
drm_fb_helper_prepare(dev, &afbdev->helper, &ast_fb_helper_funcs);
|
|
|
|
|
drm: Rely on mode_config data for fb_helper initialization
Instead of receiving the num_crts as a parameter, we can read it
directly from the mode_config structure. I audited the drivers that
invoke this helper and I believe all of them initialize the mode_config
struct accordingly, prior to calling the fb_helper.
I used the following coccinelle hack to make this transformation, except
for the function headers and comment updates. The first and second
rules are split because I couldn't find a way to remove the unused
temporary variables at the same time I removed the parameter.
// <smpl>
@r@
expression A,B,D,E;
identifier C;
@@
(
- drm_fb_helper_init(A,B,C,D)
+ drm_fb_helper_init(A,B,D)
|
- drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
+ drm_fbdev_cma_init_with_funcs(A,B,D,E)
|
- drm_fbdev_cma_init(A,B,C,D)
+ drm_fbdev_cma_init(A,B,D)
)
@@
expression A,B,C,D,E;
@@
(
- drm_fb_helper_init(A,B,C,D)
+ drm_fb_helper_init(A,B,D)
|
- drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
+ drm_fbdev_cma_init_with_funcs(A,B,D,E)
|
- drm_fbdev_cma_init(A,B,C,D)
+ drm_fbdev_cma_init(A,B,D)
)
@@
identifier r.C;
type T;
expression V;
@@
- T C;
<...
when != C
- C = V;
...>
// </smpl>
Changes since v1:
- Rebased on top of the tip of drm-misc-next.
- Remove mention to sti since a proper fix got merged.
Suggested-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170202162640.27261-1-krisman@collabora.co.uk
2017-02-02 23:26:40 +07:00
|
|
|
ret = drm_fb_helper_init(dev, &afbdev->helper, 1);
|
2014-12-19 17:21:32 +07:00
|
|
|
if (ret)
|
|
|
|
goto free;
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
|
2014-12-19 17:21:32 +07:00
|
|
|
ret = drm_fb_helper_single_add_all_connectors(&afbdev->helper);
|
|
|
|
if (ret)
|
|
|
|
goto fini;
|
2013-01-21 05:12:54 +07:00
|
|
|
|
|
|
|
/* disable all the possible outputs/crtcs before entering KMS mode */
|
|
|
|
drm_helper_disable_unused_functions(dev);
|
|
|
|
|
2014-12-19 17:21:32 +07:00
|
|
|
ret = drm_fb_helper_initial_config(&afbdev->helper, 32);
|
|
|
|
if (ret)
|
|
|
|
goto fini;
|
|
|
|
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
return 0;
|
2014-12-19 17:21:32 +07:00
|
|
|
|
|
|
|
fini:
|
|
|
|
drm_fb_helper_fini(&afbdev->helper);
|
|
|
|
free:
|
|
|
|
kfree(afbdev);
|
|
|
|
return ret;
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
void ast_fbdev_fini(struct drm_device *dev)
|
|
|
|
{
|
|
|
|
struct ast_private *ast = dev->dev_private;
|
|
|
|
|
|
|
|
if (!ast->fbdev)
|
|
|
|
return;
|
|
|
|
|
|
|
|
ast_fbdev_destroy(dev, ast->fbdev);
|
|
|
|
kfree(ast->fbdev);
|
|
|
|
ast->fbdev = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ast_fbdev_set_suspend(struct drm_device *dev, int state)
|
|
|
|
{
|
|
|
|
struct ast_private *ast = dev->dev_private;
|
|
|
|
|
|
|
|
if (!ast->fbdev)
|
|
|
|
return;
|
|
|
|
|
2015-07-22 16:28:05 +07:00
|
|
|
drm_fb_helper_set_suspend(&ast->fbdev->helper, state);
|
drm: Initial KMS driver for AST (ASpeed Technologies) 2000 series (v2)
This is the initial driver for the Aspeed Technologies chips found in
servers. This driver supports the AST 2000, 2100, 2200, 2150 and 2300. It
doesn't support the AST11xx due to lack of hw to test it on, and them requiring
different codepaths.
This driver is intended to be used with xf86-video-modesetting in userspace.
This driver has a slightly different design than other KMS drivers, but
future server chips will probably share similiar setup. As these GPUs commonly
have low video RAM, it doesn't make sense to put the kms console in VRAM
always. This driver places the kms console into system RAM, and does dirty
updates to a copy in video RAM. When userspace sets a new scanout buffer,
it forcefully evicts the video RAM console, and X can create a framebuffer
that can use all of of video RAM.
This driver uses TTM but in a very simple fashion to control the eviction
to system RAM of the console, and multiple servers.
v2: add s/r support, fix Kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-29 20:40:04 +07:00
|
|
|
}
|
2014-06-11 19:59:55 +07:00
|
|
|
|
|
|
|
void ast_fbdev_set_base(struct ast_private *ast, unsigned long gpu_addr)
|
|
|
|
{
|
|
|
|
ast->fbdev->helper.fbdev->fix.smem_start =
|
|
|
|
ast->fbdev->helper.fbdev->apertures->ranges[0].base + gpu_addr;
|
|
|
|
ast->fbdev->helper.fbdev->fix.smem_len = ast->vram_size - gpu_addr;
|
|
|
|
}
|