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>
|
|
|
|
*/
|
2019-06-30 13:19:21 +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 <linux/console.h>
|
2019-06-30 13:19:21 +07:00
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/pci.h>
|
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
|
|
|
|
2012-10-03 00:01:07 +07:00
|
|
|
#include <drm/drm_crtc_helper.h>
|
2019-06-30 13:19:21 +07:00
|
|
|
#include <drm/drm_drv.h>
|
2020-04-08 15:26:32 +07:00
|
|
|
#include <drm/drm_fb_helper.h>
|
2019-06-30 13:19:21 +07:00
|
|
|
#include <drm/drm_gem_vram_helper.h>
|
2019-01-18 04:03:34 +07:00
|
|
|
#include <drm/drm_probe_helper.h>
|
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"
|
|
|
|
|
|
|
|
int ast_modeset = -1;
|
|
|
|
|
|
|
|
MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
|
|
|
|
module_param_named(modeset, ast_modeset, int, 0400);
|
|
|
|
|
|
|
|
#define PCI_VENDOR_ASPEED 0x1a03
|
|
|
|
|
|
|
|
static struct drm_driver driver;
|
|
|
|
|
|
|
|
#define AST_VGA_DEVICE(id, info) { \
|
|
|
|
.class = PCI_BASE_CLASS_DISPLAY << 16, \
|
|
|
|
.class_mask = 0xff0000, \
|
|
|
|
.vendor = PCI_VENDOR_ASPEED, \
|
|
|
|
.device = id, \
|
|
|
|
.subvendor = PCI_ANY_ID, \
|
|
|
|
.subdevice = PCI_ANY_ID, \
|
|
|
|
.driver_data = (unsigned long) info }
|
|
|
|
|
2014-08-08 20:56:03 +07:00
|
|
|
static const struct pci_device_id pciidlist[] = {
|
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_VGA_DEVICE(PCI_CHIP_AST2000, NULL),
|
|
|
|
AST_VGA_DEVICE(PCI_CHIP_AST2100, NULL),
|
|
|
|
{0, 0, 0},
|
|
|
|
};
|
|
|
|
|
|
|
|
MODULE_DEVICE_TABLE(pci, pciidlist);
|
|
|
|
|
2018-11-15 17:42:16 +07:00
|
|
|
static void ast_kick_out_firmware_fb(struct pci_dev *pdev)
|
|
|
|
{
|
|
|
|
struct apertures_struct *ap;
|
|
|
|
bool primary = false;
|
|
|
|
|
|
|
|
ap = alloc_apertures(1);
|
|
|
|
if (!ap)
|
|
|
|
return;
|
|
|
|
|
|
|
|
ap->ranges[0].base = pci_resource_start(pdev, 0);
|
|
|
|
ap->ranges[0].size = pci_resource_len(pdev, 0);
|
|
|
|
|
|
|
|
#ifdef CONFIG_X86
|
|
|
|
primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
|
|
|
|
#endif
|
|
|
|
drm_fb_helper_remove_conflicting_framebuffers(ap, "astdrmfb", primary);
|
|
|
|
kfree(ap);
|
|
|
|
}
|
|
|
|
|
2012-12-22 06:09:25 +07:00
|
|
|
static int ast_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
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
|
|
|
{
|
2019-11-13 22:58:56 +07:00
|
|
|
struct drm_device *dev;
|
|
|
|
int ret;
|
|
|
|
|
2018-11-15 17:42:16 +07:00
|
|
|
ast_kick_out_firmware_fb(pdev);
|
|
|
|
|
2020-04-15 14:40:32 +07:00
|
|
|
ret = pcim_enable_device(pdev);
|
2019-11-13 22:58:56 +07:00
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
dev = drm_dev_alloc(&driver, &pdev->dev);
|
2020-04-15 14:40:32 +07:00
|
|
|
if (IS_ERR(dev))
|
|
|
|
return PTR_ERR(dev);
|
2019-11-13 22:58:56 +07:00
|
|
|
|
|
|
|
dev->pdev = pdev;
|
|
|
|
pci_set_drvdata(pdev, dev);
|
|
|
|
|
2019-11-13 22:58:57 +07:00
|
|
|
ret = ast_driver_load(dev, ent->driver_data);
|
2019-11-13 22:58:56 +07:00
|
|
|
if (ret)
|
|
|
|
goto err_drm_dev_put;
|
|
|
|
|
2019-11-13 22:58:57 +07:00
|
|
|
ret = drm_dev_register(dev, ent->driver_data);
|
|
|
|
if (ret)
|
|
|
|
goto err_ast_driver_unload;
|
|
|
|
|
2020-04-08 15:26:32 +07:00
|
|
|
drm_fbdev_generic_setup(dev, 32);
|
|
|
|
|
2019-11-13 22:58:56 +07:00
|
|
|
return 0;
|
|
|
|
|
2019-11-13 22:58:57 +07:00
|
|
|
err_ast_driver_unload:
|
|
|
|
ast_driver_unload(dev);
|
2019-11-13 22:58:56 +07:00
|
|
|
err_drm_dev_put:
|
|
|
|
drm_dev_put(dev);
|
|
|
|
return ret;
|
2019-11-13 22:58:57 +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
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ast_pci_remove(struct pci_dev *pdev)
|
|
|
|
{
|
|
|
|
struct drm_device *dev = pci_get_drvdata(pdev);
|
|
|
|
|
2019-11-13 22:58:56 +07:00
|
|
|
drm_dev_unregister(dev);
|
2019-11-13 22:58:57 +07:00
|
|
|
ast_driver_unload(dev);
|
2019-11-13 22:58:56 +07:00
|
|
|
drm_dev_put(dev);
|
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 int ast_drm_freeze(struct drm_device *dev)
|
|
|
|
{
|
2019-11-07 15:34:04 +07:00
|
|
|
int error;
|
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
|
|
|
|
2019-11-07 15:34:04 +07:00
|
|
|
error = drm_mode_config_helper_suspend(dev);
|
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
pci_save_state(dev->pdev);
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ast_drm_thaw(struct drm_device *dev)
|
|
|
|
{
|
|
|
|
ast_post_gpu(dev);
|
|
|
|
|
2019-11-07 15:34:04 +07:00
|
|
|
return drm_mode_config_helper_resume(dev);
|
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 int ast_drm_resume(struct drm_device *dev)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
if (pci_enable_device(dev->pdev))
|
|
|
|
return -EIO;
|
|
|
|
|
|
|
|
ret = ast_drm_thaw(dev);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ast_pm_suspend(struct device *dev)
|
|
|
|
{
|
|
|
|
struct pci_dev *pdev = to_pci_dev(dev);
|
|
|
|
struct drm_device *ddev = pci_get_drvdata(pdev);
|
|
|
|
int error;
|
|
|
|
|
|
|
|
error = ast_drm_freeze(ddev);
|
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
pci_disable_device(pdev);
|
|
|
|
pci_set_power_state(pdev, PCI_D3hot);
|
|
|
|
return 0;
|
|
|
|
}
|
2019-11-07 15:34:04 +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
|
|
|
static int ast_pm_resume(struct device *dev)
|
|
|
|
{
|
|
|
|
struct pci_dev *pdev = to_pci_dev(dev);
|
|
|
|
struct drm_device *ddev = pci_get_drvdata(pdev);
|
|
|
|
return ast_drm_resume(ddev);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ast_pm_freeze(struct device *dev)
|
|
|
|
{
|
|
|
|
struct pci_dev *pdev = to_pci_dev(dev);
|
|
|
|
struct drm_device *ddev = pci_get_drvdata(pdev);
|
|
|
|
return ast_drm_freeze(ddev);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ast_pm_thaw(struct device *dev)
|
|
|
|
{
|
|
|
|
struct pci_dev *pdev = to_pci_dev(dev);
|
|
|
|
struct drm_device *ddev = pci_get_drvdata(pdev);
|
|
|
|
return ast_drm_thaw(ddev);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ast_pm_poweroff(struct device *dev)
|
|
|
|
{
|
|
|
|
struct pci_dev *pdev = to_pci_dev(dev);
|
|
|
|
struct drm_device *ddev = pci_get_drvdata(pdev);
|
|
|
|
|
|
|
|
return ast_drm_freeze(ddev);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct dev_pm_ops ast_pm_ops = {
|
|
|
|
.suspend = ast_pm_suspend,
|
|
|
|
.resume = ast_pm_resume,
|
|
|
|
.freeze = ast_pm_freeze,
|
|
|
|
.thaw = ast_pm_thaw,
|
|
|
|
.poweroff = ast_pm_poweroff,
|
|
|
|
.restore = ast_pm_resume,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct pci_driver ast_pci_driver = {
|
|
|
|
.name = DRIVER_NAME,
|
|
|
|
.id_table = pciidlist,
|
|
|
|
.probe = ast_pci_probe,
|
|
|
|
.remove = ast_pci_remove,
|
|
|
|
.driver.pm = &ast_pm_ops,
|
|
|
|
};
|
|
|
|
|
2019-10-16 18:52:03 +07:00
|
|
|
DEFINE_DRM_GEM_FOPS(ast_fops);
|
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 struct drm_driver driver = {
|
2019-11-07 15:34:04 +07:00
|
|
|
.driver_features = DRIVER_ATOMIC |
|
|
|
|
DRIVER_GEM |
|
|
|
|
DRIVER_MODESET,
|
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
|
|
|
|
|
|
|
.fops = &ast_fops,
|
|
|
|
.name = DRIVER_NAME,
|
|
|
|
.desc = DRIVER_DESC,
|
|
|
|
.date = DRIVER_DATE,
|
|
|
|
.major = DRIVER_MAJOR,
|
|
|
|
.minor = DRIVER_MINOR,
|
|
|
|
.patchlevel = DRIVER_PATCHLEVEL,
|
|
|
|
|
2019-05-08 15:26:20 +07:00
|
|
|
DRM_GEM_VRAM_DRIVER
|
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 int __init ast_init(void)
|
|
|
|
{
|
|
|
|
if (vgacon_text_force() && ast_modeset == -1)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
if (ast_modeset == 0)
|
|
|
|
return -EINVAL;
|
2017-05-24 21:51:40 +07:00
|
|
|
return pci_register_driver(&ast_pci_driver);
|
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 __exit ast_exit(void)
|
|
|
|
{
|
2017-05-24 21:51:40 +07:00
|
|
|
pci_unregister_driver(&ast_pci_driver);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
module_init(ast_init);
|
|
|
|
module_exit(ast_exit);
|
|
|
|
|
|
|
|
MODULE_AUTHOR(DRIVER_AUTHOR);
|
|
|
|
MODULE_DESCRIPTION(DRIVER_DESC);
|
|
|
|
MODULE_LICENSE("GPL and additional rights");
|
|
|
|
|