Skip to content

Commit

Permalink
minigbm: fix some formating
Browse files Browse the repository at this point in the history
TEST=./presubmit.sh

Change-Id: Ia53da4264de6ab637a21ad55029024c52a253c0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3761444
Tested-by: Yiwei Zhang <[email protected]>
Reviewed-by: Jason Macnak <[email protected]>
Auto-Submit: Yiwei Zhang <[email protected]>
Reviewed-by: Dominik Behr <[email protected]>
Commit-Queue: Yiwei Zhang <[email protected]>
  • Loading branch information
zhangyiwei authored and Chromeos LUCI committed Jul 15, 2022
1 parent 7b3cbea commit 7648f06
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
8 changes: 4 additions & 4 deletions amdgpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,8 @@ static int amdgpu_create_bo_linear(struct bo *bo, uint32_t width, uint32_t heigh
* families, but let's restrict it to Raven and Stoney for now (b/171013552, b/190484589).
* This only applies to the Android YUV (multiplane) format.
* */
if (format == DRM_FORMAT_YVU420_ANDROID &&
(priv->dev_info.family == AMDGPU_FAMILY_RV || priv->dev_info.family == AMDGPU_FAMILY_CZ))
if (format == DRM_FORMAT_YVU420_ANDROID && (priv->dev_info.family == AMDGPU_FAMILY_RV ||
priv->dev_info.family == AMDGPU_FAMILY_CZ))
stride = ALIGN(stride, 512);
else
stride = ALIGN(stride, 256);
Expand Down Expand Up @@ -625,8 +625,8 @@ static int amdgpu_import_bo(struct bo *bo, struct drv_import_fd_data *data)
dri_tiling = combo->metadata.tiling != TILE_TYPE_LINEAR;
}

bo->meta.num_planes = dri_num_planes_from_modifier(bo->drv, data->format,
data->format_modifier);
bo->meta.num_planes =
dri_num_planes_from_modifier(bo->drv, data->format, data->format_modifier);

if (dri_tiling)
return dri_bo_import(bo, data);
Expand Down
17 changes: 7 additions & 10 deletions i915.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,9 @@ static void i915_info_from_device_id(struct i915_device *i915)
0x46b3, 0x46c0, 0x46c1, 0x46c2, 0x46c3, 0x9A40, 0x9A49, 0x9A59, 0x9A60, 0x9A68,
0x9A70, 0x9A78, 0x9AC0, 0x9AC9, 0x9AD9, 0x9AF8, 0x4905, 0x4906, 0x4907, 0x4908
};
const uint16_t adlp_ids[] = { 0x46A0, 0x46A1, 0x46A2, 0x46A3, 0x46A6, 0x46A8,
0x46AA, 0x462A, 0x4626, 0x4628, 0x46B0, 0x46B1,
0x46B2, 0x46B3, 0x46C0, 0x46C1, 0x46C2, 0x46C3,
0x46D0, 0x46D1, 0x46D2 };
const uint16_t adlp_ids[] = { 0x46A0, 0x46A1, 0x46A2, 0x46A3, 0x46A6, 0x46A8, 0x46AA,
0x462A, 0x4626, 0x4628, 0x46B0, 0x46B1, 0x46B2, 0x46B3,
0x46C0, 0x46C1, 0x46C2, 0x46C3, 0x46D0, 0x46D1, 0x46D2 };

const uint16_t rplp_ids[] = { 0xA720, 0xA721, 0xA7A0, 0xA7A1, 0xA7A8, 0xA7A9 };
unsigned i;
Expand Down Expand Up @@ -175,8 +174,7 @@ static void i915_get_modifier_order(struct i915_device *i915)
if (i915->gen == 12) {
i915->modifier.order = gen12_modifier_order;
i915->modifier.count = ARRAY_SIZE(gen12_modifier_order);
}
else if (i915->gen == 11) {
} else if (i915->gen == 11) {
i915->modifier.order = gen11_modifier_order;
i915->modifier.count = ARRAY_SIZE(gen11_modifier_order);
} else {
Expand Down Expand Up @@ -449,8 +447,7 @@ static int i915_bo_from_format(struct bo *bo, uint32_t width, uint32_t height, u
return 0;
}

static size_t i915_num_planes_from_modifier(struct driver *drv, uint32_t format,
uint64_t modifier)
static size_t i915_num_planes_from_modifier(struct driver *drv, uint32_t format, uint64_t modifier)
{
size_t num_planes = drv_num_planes_from_format(format);
if (modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
Expand Down Expand Up @@ -699,8 +696,8 @@ static int i915_bo_import(struct bo *bo, struct drv_import_fd_data *data)
int ret;
struct drm_i915_gem_get_tiling gem_get_tiling = { 0 };

bo->meta.num_planes = i915_num_planes_from_modifier(bo->drv, data->format,
data->format_modifier);
bo->meta.num_planes =
i915_num_planes_from_modifier(bo->drv, data->format, data->format_modifier);

ret = drv_prime_bo_import(bo, data);
if (ret)
Expand Down
6 changes: 3 additions & 3 deletions msm.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@

#define MSM_UBWC_TILING 1

static const uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB8888,
DRM_FORMAT_RGB565, DRM_FORMAT_XBGR8888,
DRM_FORMAT_XRGB8888, DRM_FORMAT_ABGR2101010,
static const uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB8888,
DRM_FORMAT_RGB565, DRM_FORMAT_XBGR8888,
DRM_FORMAT_XRGB8888, DRM_FORMAT_ABGR2101010,
DRM_FORMAT_ABGR16161616F };

static const uint32_t texture_source_formats[] = { DRM_FORMAT_NV12, DRM_FORMAT_R8,
Expand Down
9 changes: 4 additions & 5 deletions virtgpu_cross_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,17 @@ static void add_combinations(struct driver *drv)

drv_modify_combination(drv, DRM_FORMAT_YVU420, &metadata, BO_USE_HW_VIDEO_ENCODER);
drv_modify_combination(drv, DRM_FORMAT_NV12, &metadata,
BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE |
BO_USE_HW_VIDEO_DECODER | BO_USE_SCANOUT | BO_USE_HW_VIDEO_ENCODER);
BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE | BO_USE_HW_VIDEO_DECODER |
BO_USE_SCANOUT | BO_USE_HW_VIDEO_ENCODER);

/*
* R8 format is used for Android's HAL_PIXEL_FORMAT_BLOB and is used for JPEG snapshots
* from camera, input/output from hardware decoder/encoder, and
* AHBs used as SSBOs/UBOs.
*/
drv_modify_combination(drv, DRM_FORMAT_R8, &metadata,
BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE |
BO_USE_HW_VIDEO_DECODER | BO_USE_HW_VIDEO_ENCODER |
BO_USE_GPU_DATA_BUFFER);
BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE | BO_USE_HW_VIDEO_DECODER |
BO_USE_HW_VIDEO_ENCODER | BO_USE_GPU_DATA_BUFFER);

drv_modify_linear_combinations(drv);
}
Expand Down

0 comments on commit 7648f06

Please sign in to comment.