mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
drm/nouveau/gsp: add hal for disp.get_static_info()
550.40.07 has incompatible changes to NV2080_CTRL_CMD_INTERNAL_DISPLAY_GET_STATIC_INFO. Signed-off-by: Ben Skeggs <bskeggs@nvidia.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Timur Tabi <ttabi@nvidia.com> Tested-by: Timur Tabi <ttabi@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
a3f3232903
commit
6854ce2c94
|
|
@ -1440,11 +1440,31 @@ r535_disp_init(struct nvkm_disp *disp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
r535_disp_get_static_info(struct nvkm_disp *disp)
|
||||
{
|
||||
NV2080_CTRL_INTERNAL_DISPLAY_GET_STATIC_INFO_PARAMS *ctrl;
|
||||
struct nvkm_gsp *gsp = disp->rm.objcom.client->gsp;
|
||||
|
||||
ctrl = nvkm_gsp_rm_ctrl_rd(&gsp->internal.device.subdevice,
|
||||
NV2080_CTRL_CMD_INTERNAL_DISPLAY_GET_STATIC_INFO,
|
||||
sizeof(*ctrl));
|
||||
if (IS_ERR(ctrl))
|
||||
return PTR_ERR(ctrl);
|
||||
|
||||
disp->wndw.mask = ctrl->windowPresentMask;
|
||||
disp->wndw.nr = fls(disp->wndw.mask);
|
||||
|
||||
nvkm_gsp_rm_ctrl_done(&gsp->internal.device.subdevice, ctrl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
r535_disp_oneinit(struct nvkm_disp *disp)
|
||||
{
|
||||
struct nvkm_device *device = disp->engine.subdev.device;
|
||||
struct nvkm_gsp *gsp = device->gsp;
|
||||
const struct nvkm_rm_api *rmapi = gsp->rm->api;
|
||||
NV2080_CTRL_INTERNAL_DISPLAY_WRITE_INST_MEM_PARAMS *ctrl;
|
||||
int ret, i;
|
||||
|
||||
|
|
@ -1481,19 +1501,9 @@ r535_disp_oneinit(struct nvkm_disp *disp)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
{
|
||||
NV2080_CTRL_INTERNAL_DISPLAY_GET_STATIC_INFO_PARAMS *ctrl;
|
||||
|
||||
ctrl = nvkm_gsp_rm_ctrl_rd(&gsp->internal.device.subdevice,
|
||||
NV2080_CTRL_CMD_INTERNAL_DISPLAY_GET_STATIC_INFO,
|
||||
sizeof(*ctrl));
|
||||
if (IS_ERR(ctrl))
|
||||
return PTR_ERR(ctrl);
|
||||
|
||||
disp->wndw.mask = ctrl->windowPresentMask;
|
||||
disp->wndw.nr = fls(disp->wndw.mask);
|
||||
nvkm_gsp_rm_ctrl_done(&gsp->internal.device.subdevice, ctrl);
|
||||
}
|
||||
ret = rmapi->disp->get_static_info(disp);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* */
|
||||
{
|
||||
|
|
@ -1733,6 +1743,7 @@ r535_disp_new(const struct nvkm_disp_func *hw, struct nvkm_device *device,
|
|||
|
||||
const struct nvkm_rm_api_disp
|
||||
r535_disp = {
|
||||
.get_static_info = r535_disp_get_static_info,
|
||||
.bl_ctrl = r535_bl_ctrl,
|
||||
.dp = {
|
||||
.set_indexed_link_rates = r535_dp_set_indexed_link_rates,
|
||||
|
|
|
|||
|
|
@ -72,6 +72,8 @@ struct nvkm_rm_api {
|
|||
} *device;
|
||||
|
||||
const struct nvkm_rm_api_disp {
|
||||
int (*get_static_info)(struct nvkm_disp *);
|
||||
|
||||
int (*bl_ctrl)(struct nvkm_disp *, unsigned display_id, bool set, int *val);
|
||||
|
||||
struct {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user