freedreno/drm: fix invalid-cmdstream-size with older kernels

A cmdstream of size zero is invalid.  But this can appear in various
places where we emit a pointer to state.  This doesn't show up with
newer kernels (newer than v5.0) which use "softpin", but on earlier
kernels can result in:

  [drm:msm_ioctl_gem_submit [msm]] *ERROR* invalid cmdstream size: 0

Since the pointer value doesn't matter in these cases, the easy solution
is just to not emit a cmds table entry in this case.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Tested-by: Marge Bot <mesa/mesa!2805>
Part-of: <mesa/mesa!2805>
38 jobs for !2805 with wip/fix-invalid-cmdstream-size in 17 minutes and 12 seconds (queued for 4 seconds)
detached
Status Job ID Name Coverage
  Container
passed arm_build #1476274
aarch64

00:00:19

passed arm_test #1476276
aarch64

00:00:21

passed x86_build #1476269

00:00:21

passed x86_build_old #1476272

00:00:23

passed x86_test-gl #1476270

00:00:19

 
  Build
passed meson-arm64 #1476284
aarch64

00:03:42

passed meson-armhf #1476281
aarch64

00:02:43

passed meson-clang #1476285

00:08:14

passed meson-clover #1476290

00:04:09

passed meson-clover-old-llvm #1476292

00:06:17

passed meson-i386 #1476295

00:01:41

passed meson-main #1476279

00:05:59

passed meson-mingw32-x86_64 #1476296

00:04:14

passed meson-testing #1476278

00:04:25

passed meson-vulkan #1476293

00:05:34

passed scons #1476297

00:04:34

passed scons-old-llvm #1476298

00:04:43

passed scons-swr #1476287

00:04:37

passed scons-win64 #1476289

00:06:44

 
  Test
passed arm64_a306_gles2 #1476317
db410c

00:08:29

passed arm64_a630_gles2 #1476314
mesa-cheza

00:02:07

passed arm64_a630_gles3 #1476316
mesa-cheza

00:06:21

passed arm64_a630_gles31 #1476315
mesa-cheza

00:04:30

passed lima-mali450-test:arm64 #1476302
lava-meson-gxl-s905x-libretech-cc

00:08:40

passed panfrost-t720-test:arm64 #1476299
lava-sun50i-h6-pine-h64

00:07:56

passed panfrost-t760-test:armhf #1476300
lava-rk3288-veyron-jaq

00:04:59

passed panfrost-t860-test:arm64 #1476301
lava-rk3399-gru-kevin

00:06:01

passed piglit-glslparser #1476304

00:03:55

passed piglit-quick_gl #1476303

00:06:44

passed piglit-quick_shader #1476305

00:05:16

passed test-llvmpipe-gles2 #1476306

00:03:56

passed test-softpipe-gles2 #1476307

00:02:00

passed test-softpipe-gles31 1/4 #1476310

00:03:10

passed test-softpipe-gles3 1/2 #1476308

00:06:33

passed test-softpipe-gles31 2/4 #1476311

00:05:44

passed test-softpipe-gles31 3/4 #1476312

00:04:51

passed test-softpipe-gles31 4/4 #1476313

00:03:11

passed test-softpipe-gles3 2/2 #1476309

00:05:09