Skip to content

Commit b4e4538

Browse files
committed
Merge tag 'drm-misc-next-2019-03-28-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for 5.2: UAPI Changes: - Remove unused DRM_DISPLAY_INFO_LEN (Ville) Cross-subsystem Changes: - None Core Changes: - Fix compilation when CONFIG_FBDEV not selected (Daniel) - fbdev: Make skip_vt_switch default (Daniel) - Merge fb_helper_fill_fix, fb_helper_fill_var into fb_helper_fill_info (Daniel) - Remove unused fields in connector, display_info, and edid_quirks (Ville) Driver Changes: - virtio: package function args in virtio_gpu_object_params (Gerd) - vkms: Fix potential NULL-dereference bug (Kangjie) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Sean Paul <sean@poorly.run> Link: https://patchwork.freedesktop.org/patch/msgid/20190328183045.GA44823@art_vandelay
2 parents 2337091 + 530b284 commit b4e4538

46 files changed

Lines changed: 292 additions & 442 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/gpu/kms-properties.csv‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Owner Module/Drivers,Group,Property Name,Type,Property Values,Object attached,De
1717
,Virtual GPU,“suggested X”,RANGE,"Min=0, Max=0xffffffff",Connector,property to suggest an X offset for a connector
1818
,,“suggested Y”,RANGE,"Min=0, Max=0xffffffff",Connector,property to suggest an Y offset for a connector
1919
,Optional,"""aspect ratio""",ENUM,"{ ""None"", ""4:3"", ""16:9"" }",Connector,TDB
20-
,Optional,"""content type""",ENUM,"{ ""No Data"", ""Graphics"", ""Photo"", ""Cinema"", ""Game"" }",Connector,TBD
2120
i915,Generic,"""Broadcast RGB""",ENUM,"{ ""Automatic"", ""Full"", ""Limited 16:235"" }",Connector,"When this property is set to Limited 16:235 and CTM is set, the hardware will be programmed with the result of the multiplication of CTM by the limited range matrix to ensure the pixels normaly in the range 0..1.0 are remapped to the range 16/255..235/255."
2221
,,“audio”,ENUM,"{ ""force-dvi"", ""off"", ""auto"", ""on"" }",Connector,TBD
2322
,SDVO-TV,“mode”,ENUM,"{ ""NTSC_M"", ""NTSC_J"", ""NTSC_443"", ""PAL_B"" } etc.",Connector,TBD

‎drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c‎

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,11 @@
4949
static int
5050
amdgpufb_open(struct fb_info *info, int user)
5151
{
52-
struct amdgpu_fbdev *rfbdev = info->par;
53-
struct amdgpu_device *adev = rfbdev->adev;
54-
int ret = pm_runtime_get_sync(adev->ddev->dev);
52+
struct drm_fb_helper *fb_helper = info->par;
53+
int ret = pm_runtime_get_sync(fb_helper->dev->dev);
5554
if (ret < 0 && ret != -EACCES) {
56-
pm_runtime_mark_last_busy(adev->ddev->dev);
57-
pm_runtime_put_autosuspend(adev->ddev->dev);
55+
pm_runtime_mark_last_busy(fb_helper->dev->dev);
56+
pm_runtime_put_autosuspend(fb_helper->dev->dev);
5857
return ret;
5958
}
6059
return 0;
@@ -63,11 +62,10 @@ amdgpufb_open(struct fb_info *info, int user)
6362
static int
6463
amdgpufb_release(struct fb_info *info, int user)
6564
{
66-
struct amdgpu_fbdev *rfbdev = info->par;
67-
struct amdgpu_device *adev = rfbdev->adev;
65+
struct drm_fb_helper *fb_helper = info->par;
6866

69-
pm_runtime_mark_last_busy(adev->ddev->dev);
70-
pm_runtime_put_autosuspend(adev->ddev->dev);
67+
pm_runtime_mark_last_busy(fb_helper->dev->dev);
68+
pm_runtime_put_autosuspend(fb_helper->dev->dev);
7169
return 0;
7270
}
7371

@@ -233,9 +231,6 @@ static int amdgpufb_create(struct drm_fb_helper *helper,
233231
goto out;
234232
}
235233

236-
info->par = rfbdev;
237-
info->skip_vt_switch = true;
238-
239234
ret = amdgpu_display_framebuffer_init(adev->ddev, &rfbdev->rfb,
240235
&mode_cmd, gobj);
241236
if (ret) {
@@ -248,10 +243,6 @@ static int amdgpufb_create(struct drm_fb_helper *helper,
248243
/* setup helper */
249244
rfbdev->helper.fb = fb;
250245

251-
strcpy(info->fix.id, "amdgpudrmfb");
252-
253-
drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
254-
255246
info->fbops = &amdgpufb_ops;
256247

257248
tmp = amdgpu_bo_gpu_offset(abo) - adev->gmc.vram_start;
@@ -260,7 +251,7 @@ static int amdgpufb_create(struct drm_fb_helper *helper,
260251
info->screen_base = amdgpu_bo_kptr(abo);
261252
info->screen_size = amdgpu_bo_size(abo);
262253

263-
drm_fb_helper_fill_var(info, &rfbdev->helper, sizes->fb_width, sizes->fb_height);
254+
drm_fb_helper_fill_info(info, &rfbdev->helper, sizes);
264255

265256
/* setup aperture base/size for vesafb takeover */
266257
info->apertures->ranges[0].base = adev->ddev->mode_config.fb_base;

‎drivers/gpu/drm/armada/armada_fbdev.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,14 @@ static int armada_fbdev_create(struct drm_fb_helper *fbh,
7878
goto err_fballoc;
7979
}
8080

81-
strlcpy(info->fix.id, "armada-drmfb", sizeof(info->fix.id));
82-
info->par = fbh;
8381
info->fbops = &armada_fb_ops;
8482
info->fix.smem_start = obj->phys_addr;
8583
info->fix.smem_len = obj->obj.size;
8684
info->screen_size = obj->obj.size;
8785
info->screen_base = ptr;
8886
fbh->fb = &dfb->fb;
8987

90-
drm_fb_helper_fill_fix(info, dfb->fb.pitches[0],
91-
dfb->fb.format->depth);
92-
drm_fb_helper_fill_var(info, fbh, sizes->fb_width, sizes->fb_height);
88+
drm_fb_helper_fill_info(info, fbh, sizes);
9389

9490
DRM_DEBUG_KMS("allocated %dx%d %dbpp fb: 0x%08llx\n",
9591
dfb->fb.width, dfb->fb.height, dfb->fb.format->cpp[0] * 8,

‎drivers/gpu/drm/ast/ast_drv.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ struct ast_framebuffer {
259259
};
260260

261261
struct ast_fbdev {
262-
struct drm_fb_helper helper;
262+
struct drm_fb_helper helper; /* must be first */
263263
struct ast_framebuffer afb;
264264
void *sysram;
265265
int size;

‎drivers/gpu/drm/ast/ast_fb.c‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,6 @@ static int astfb_create(struct drm_fb_helper *helper,
217217
ret = PTR_ERR(info);
218218
goto out;
219219
}
220-
info->par = afbdev;
221-
222220
ret = ast_framebuffer_init(dev, &afbdev->afb, &mode_cmd, gobj);
223221
if (ret)
224222
goto out;
@@ -229,15 +227,12 @@ static int astfb_create(struct drm_fb_helper *helper,
229227
fb = &afbdev->afb.base;
230228
afbdev->helper.fb = fb;
231229

232-
strcpy(info->fix.id, "astdrmfb");
233-
234230
info->fbops = &astfb_ops;
235231

236232
info->apertures->ranges[0].base = pci_resource_start(dev->pdev, 0);
237233
info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0);
238234

239-
drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
240-
drm_fb_helper_fill_var(info, &afbdev->helper, sizes->fb_width, sizes->fb_height);
235+
drm_fb_helper_fill_info(info, &afbdev->helper, sizes);
241236

242237
info->screen_base = sysram;
243238
info->screen_size = size;

‎drivers/gpu/drm/cirrus/cirrus_drv.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ struct cirrus_device {
143143

144144

145145
struct cirrus_fbdev {
146-
struct drm_fb_helper helper;
146+
struct drm_fb_helper helper; /* must be first */
147147
struct drm_framebuffer *gfb;
148148
void *sysram;
149149
int size;

‎drivers/gpu/drm/cirrus/cirrus_fbdev.c‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@ static int cirrusfb_create(struct drm_fb_helper *helper,
195195
goto err_vfree;
196196
}
197197

198-
info->par = gfbdev;
199-
200198
fb = kzalloc(sizeof(*fb), GFP_KERNEL);
201199
if (!fb) {
202200
ret = -ENOMEM;
@@ -214,13 +212,9 @@ static int cirrusfb_create(struct drm_fb_helper *helper,
214212
/* setup helper */
215213
gfbdev->helper.fb = fb;
216214

217-
strcpy(info->fix.id, "cirrusdrmfb");
218-
219215
info->fbops = &cirrusfb_ops;
220216

221-
drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
222-
drm_fb_helper_fill_var(info, &gfbdev->helper, sizes->fb_width,
223-
sizes->fb_height);
217+
drm_fb_helper_fill_info(info, &gfbdev->helper, sizes);
224218

225219
/* setup aperture base/size for vesafb takeover */
226220
info->apertures->ranges[0].base = cdev->dev->mode_config.fb_base;

‎drivers/gpu/drm/drm_edid.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@
6868
* maximum size and use that.
6969
*/
7070
#define EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE (1 << 4)
71-
/* Monitor forgot to set the first detailed is preferred bit. */
72-
#define EDID_QUIRK_FIRST_DETAILED_PREFERRED (1 << 5)
7371
/* use +hsync +vsync for detailed mode */
7472
#define EDID_QUIRK_DETAILED_SYNC_PP (1 << 6)
7573
/* Force reduced-blanking timings for detailed modes */
@@ -107,8 +105,6 @@ static const struct edid_quirk {
107105
{ "ACR", 44358, EDID_QUIRK_PREFER_LARGE_60 },
108106
/* Acer F51 */
109107
{ "API", 0x7602, EDID_QUIRK_PREFER_LARGE_60 },
110-
/* Unknown Acer */
111-
{ "ACR", 2423, EDID_QUIRK_FIRST_DETAILED_PREFERRED },
112108

113109
/* AEO model 0 reports 8 bpc, but is a 6 bpc panel */
114110
{ "AEO", 0, EDID_QUIRK_FORCE_6BPC },
@@ -145,12 +141,6 @@ static const struct edid_quirk {
145141
{ "LPL", 0, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE },
146142
{ "LPL", 0x2a00, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE },
147143

148-
/* Philips 107p5 CRT */
149-
{ "PHL", 57364, EDID_QUIRK_FIRST_DETAILED_PREFERRED },
150-
151-
/* Proview AY765C */
152-
{ "PTS", 765, EDID_QUIRK_FIRST_DETAILED_PREFERRED },
153-
154144
/* Samsung SyncMaster 205BW. Note: irony */
155145
{ "SAM", 541, EDID_QUIRK_DETAILED_SYNC_PP },
156146
/* Samsung SyncMaster 22[5-6]BW */

‎drivers/gpu/drm/drm_fb_helper.c‎

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,7 @@ struct fb_info *drm_fb_helper_alloc_fbi(struct drm_fb_helper *fb_helper)
934934
}
935935

936936
fb_helper->fbdev = info;
937+
info->skip_vt_switch = true;
937938

938939
return info;
939940

@@ -2036,21 +2037,8 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
20362037
return 0;
20372038
}
20382039

2039-
/**
2040-
* drm_fb_helper_fill_fix - initializes fixed fbdev information
2041-
* @info: fbdev registered by the helper
2042-
* @pitch: desired pitch
2043-
* @depth: desired depth
2044-
*
2045-
* Helper to fill in the fixed fbdev information useful for a non-accelerated
2046-
* fbdev emulations. Drivers which support acceleration methods which impose
2047-
* additional constraints need to set up their own limits.
2048-
*
2049-
* Drivers should call this (or their equivalent setup code) from their
2050-
* &drm_fb_helper_funcs.fb_probe callback.
2051-
*/
2052-
void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
2053-
uint32_t depth)
2040+
static void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
2041+
uint32_t depth)
20542042
{
20552043
info->fix.type = FB_TYPE_PACKED_PIXELS;
20562044
info->fix.visual = depth == 8 ? FB_VISUAL_PSEUDOCOLOR :
@@ -2065,24 +2053,10 @@ void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
20652053

20662054
info->fix.line_length = pitch;
20672055
}
2068-
EXPORT_SYMBOL(drm_fb_helper_fill_fix);
20692056

2070-
/**
2071-
* drm_fb_helper_fill_var - initalizes variable fbdev information
2072-
* @info: fbdev instance to set up
2073-
* @fb_helper: fb helper instance to use as template
2074-
* @fb_width: desired fb width
2075-
* @fb_height: desired fb height
2076-
*
2077-
* Sets up the variable fbdev metainformation from the given fb helper instance
2078-
* and the drm framebuffer allocated in &drm_fb_helper.fb.
2079-
*
2080-
* Drivers should call this (or their equivalent setup code) from their
2081-
* &drm_fb_helper_funcs.fb_probe callback after having allocated the fbdev
2082-
* backing storage framebuffer.
2083-
*/
2084-
void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
2085-
uint32_t fb_width, uint32_t fb_height)
2057+
static void drm_fb_helper_fill_var(struct fb_info *info,
2058+
struct drm_fb_helper *fb_helper,
2059+
uint32_t fb_width, uint32_t fb_height)
20862060
{
20872061
struct drm_framebuffer *fb = fb_helper->fb;
20882062

@@ -2102,7 +2076,36 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe
21022076
info->var.xres = fb_width;
21032077
info->var.yres = fb_height;
21042078
}
2105-
EXPORT_SYMBOL(drm_fb_helper_fill_var);
2079+
2080+
/**
2081+
* drm_fb_helper_fill_info - initializes fbdev information
2082+
* @info: fbdev instance to set up
2083+
* @fb_helper: fb helper instance to use as template
2084+
* @sizes: describes fbdev size and scanout surface size
2085+
*
2086+
* Sets up the variable and fixed fbdev metainformation from the given fb helper
2087+
* instance and the drm framebuffer allocated in &drm_fb_helper.fb.
2088+
*
2089+
* Drivers should call this (or their equivalent setup code) from their
2090+
* &drm_fb_helper_funcs.fb_probe callback after having allocated the fbdev
2091+
* backing storage framebuffer.
2092+
*/
2093+
void drm_fb_helper_fill_info(struct fb_info *info,
2094+
struct drm_fb_helper *fb_helper,
2095+
struct drm_fb_helper_surface_size *sizes)
2096+
{
2097+
struct drm_framebuffer *fb = fb_helper->fb;
2098+
2099+
drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
2100+
drm_fb_helper_fill_var(info, fb_helper,
2101+
sizes->fb_width, sizes->fb_height);
2102+
2103+
info->par = fb_helper;
2104+
snprintf(info->fix.id, sizeof(info->fix.id), "%sdrmfb",
2105+
fb_helper->dev->driver->name);
2106+
2107+
}
2108+
EXPORT_SYMBOL(drm_fb_helper_fill_info);
21062109

21072110
static int drm_fb_helper_probe_connector_modes(struct drm_fb_helper *fb_helper,
21082111
uint32_t maxX,
@@ -2780,9 +2783,8 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper,
27802783
*
27812784
* This function will call down into the &drm_fb_helper_funcs.fb_probe callback
27822785
* to let the driver allocate and initialize the fbdev info structure and the
2783-
* drm framebuffer used to back the fbdev. drm_fb_helper_fill_var() and
2784-
* drm_fb_helper_fill_fix() are provided as helpers to setup simple default
2785-
* values for the fbdev info structure.
2786+
* drm framebuffer used to back the fbdev. drm_fb_helper_fill_info() is provided
2787+
* as a helper to setup simple default values for the fbdev info structure.
27862788
*
27872789
* HANG DEBUGGING:
27882790
*
@@ -3151,7 +3153,6 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,
31513153
if (IS_ERR(fbi))
31523154
return PTR_ERR(fbi);
31533155

3154-
fbi->par = fb_helper;
31553156
fbi->fbops = &drm_fbdev_fb_ops;
31563157
fbi->screen_size = fb->height * fb->pitches[0];
31573158
fbi->fix.smem_len = fbi->screen_size;
@@ -3162,10 +3163,7 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,
31623163
fbi->fix.smem_start =
31633164
page_to_phys(virt_to_page(fbi->screen_buffer));
31643165
#endif
3165-
strcpy(fbi->fix.id, "DRM emulated");
3166-
3167-
drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->format->depth);
3168-
drm_fb_helper_fill_var(fbi, fb_helper, sizes->fb_width, sizes->fb_height);
3166+
drm_fb_helper_fill_info(fbi, fb_helper, sizes);
31693167

31703168
if (fb->funcs->dirty) {
31713169
struct fb_ops *fbops;

‎drivers/gpu/drm/exynos/exynos_drm_fbdev.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,9 @@ static int exynos_drm_fbdev_update(struct drm_fb_helper *helper,
8787
return PTR_ERR(fbi);
8888
}
8989

90-
fbi->par = helper;
9190
fbi->fbops = &exynos_drm_fb_ops;
9291

93-
drm_fb_helper_fill_fix(fbi, fb->pitches[0], fb->format->depth);
94-
drm_fb_helper_fill_var(fbi, helper, sizes->fb_width, sizes->fb_height);
92+
drm_fb_helper_fill_info(fbi, helper, sizes);
9593

9694
nr_pages = exynos_gem->size >> PAGE_SHIFT;
9795

0 commit comments

Comments
 (0)